php help - need to echo php using strings
<p>I am trying to add a few things mentioned below on my php code, but its throwing a parse error, when i try to open with firefox or any other browser for thar matter...hence would like some expertize on this one...</p>

<pre><code>&lt;?php

$var1 = array();
//These are two of my website abc.com &amp; abcdef.info...
$var1[] = "http://abc.com";
$var1[] = "http://abcdef.info";

$var2   = $var1[array_rand($var1)];

?&gt;

//Now i need to echo $var2 on all 3 strings below, but as you see sometimes the echo needs to be executed not only by the end of the string but between the links of the below mentioned strings, so that i would be able to echo the final result from $test onto $var3.
&lt;?php

$tests = array();
//three strings
$tests[] = "http://www.123.com/folder/subfolder.php?u="&lt;?php echo "$var2";?&gt;"";
$tests[] = "http://www.456.com?u="&lt;?php echo "$var2";?&gt;"&amp;myimagelink&amp;mydescription";
$tests[] = "http://www.some-other-site.com/okay/?u="&lt;?php echo "$var2";?&gt;"&amp;myimagelink&amp;mydescription";

$test   = $tests[array_rand($tests)];

?&gt;

//an example of what needs to be printed according to a browser point of view is $var3 = http://www.456.com?u=http://abcdef.info&amp;myimagelink&amp;mydescription";
$var3 = "&lt;?php echo "$var2";?&gt;"
</code></pre>
