PHP Echo URL - add target?
<p>I can't seem to add a target to the URL without getting an error :/
Could anyone please be so kind to help out? Thanks!</p>

<pre><code>&lt;?php 
echo "&lt;a href=\"".$banner[$random]['link']."\"&gt;&lt;img src=\"".$banner[$random]['img']."\" border=\"0\"&gt;&lt;/a&gt;";
//result
?&gt;
</code></pre>

<p>I've tried this solution;</p>

<pre><code>echo "&lt;a href=\"".$banner[$random]['link']."\"&gt;&lt;img src=\"".$banner[$random]['img']."\" border=\"0\".'" target="_blank"&gt;&lt;/a&gt;";
</code></pre>

<p>This is the full code (it's a random image + URL script):</p>

<pre><code>&lt;?php 
$banner[1]['link'] = "http://www.url.com";
$banner[1]['img'] = "/banners/square_1.jpg";

$banner[2]['link'] = "http://url.com";
$banner[2]['img'] = "/banners/square_2.jpg";

//number of banners
$banners=2; 

srand((double)microtime()*1000000);     

$random = rand(1,$banners);     

echo "&lt;a href=\"".$banner[$random]['link']."\"&gt;&lt;img src=\"".$banner[$random]['img']."\" border=\"0\"&gt;&lt;/a&gt;";
//result
?&gt;
</code></pre>
