Inserting PHP code inside JavaScript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1849812/php-in-javascript">php in javascript?</a>  </p>
</blockquote>



<p>I need to check an if condition inside the inner html property of javascript. And  so for that I need to use php inside it. So is it possible. I tried the following and it doesn't seem to work.</p>

<pre><code>document.getElementById().innerHTML = 
    "&lt;?php if ($number == 1) { echo $ex; } else { echo $ey; } ?&gt;";
</code></pre>

<p>So please help me out with this problem.</p>
