title: JavaScript jQuery inside PHP function
body: <p>This is a theoretical question.
  My question is whether a jQuery function or script can be written inside a PHP function.
  E.g. </p>
  
  <pre><code>&lt;?php function phpfunc(){
  $a=10; ?&gt;
  
  &lt;script&gt;var a ='&lt;?php $a ?&gt;'&lt;/SCRIPT&gt; &lt;?php } ?&gt;
  </code></pre>
  
  <p>Is this possible and legal?</p>