<?php 
$src='image/'; 
$pic[0]='jay6.gif';
$pic[1]='jay2.gif'; 
$pic[2]='jay3.gif'; 
$pic[3]='jay4.gif'; 
$pic[4]='jay5.gif'; 
$img = rand(0,4); 
echo '<img src='.$src.$pic[$img].' />'; 
?>上面是一段随意产生图片的代码,我想在这个基础上加入超级链接,但是不知道如何加入,请大家指教一下!谢谢!

解决方案 »

  1.   


    <?php 
    $src='image/'; 
    $pic[0]='jay6.gif'; 
    $pic[1]='jay2.gif'; 
    $pic[2]='jay3.gif'; 
    $pic[3]='jay4.gif'; 
    $pic[4]='jay5.gif'; 
    $img = rand(0,4); 
    echo ' <a href="#"><img src='.$src.$pic[$img].' /></a>'; 
    ?> 
      

  2.   

    <?php 
    $src='image/'; 
    $pic[0]='jay6.gif'; 
    $pic[1]='jay2.gif'; 
    $pic[2]='jay3.gif'; 
    $pic[3]='jay4.gif'; 
    $pic[4]='jay5.gif'; $link[0]='0.html'; 
    $link[1]='1.html'; 
    $link[2]='2.html'; 
    $link[3]='3.html'; 
    $link[4]='4.html'; $img = rand(0,4); 
    echo ' <a href='.$link[$img].'><img src='.$src.$pic[$img].'</a> />'; 
    ?> 
      

  3.   

    To remind you to note that, you pay attention to the diamond weight at the same time, we must note that the diamonds color, clarity, cut, that is, comprehensive consideration "4c" Standard. thomas sabo charms