Echo random string within value element
<p>I have an input element ( search box ) and in the value element I am trying to echo a random string.</p>

<p>So example: I have </p>

<pre><code>&lt;input class="input-xxlarge" type="text" id="search" value="&lt;?php echo($num);?&gt;" /&gt;
</code></pre>

<p>For the random string i am using this crude code</p>

<pre><code>&lt;?php
 $num = Rand (1,3); 
  switch ($num)
  {
  case 1:
  echo "eg. Sydney, NSW";
  break;
  case 2:
  echo "eg. Manly, NSW";
  break;
  case 3:
 echo "eg. Jimboomba, QLD";
 }
?&gt; 
</code></pre>

<p>For some reason, I just get the value echoed as the php code.</p>

<p>Any ideas, I have pulled most of my hair out</p>
