<%
randomize()
r=rnd()
if r>0.5 then '显示几率
response.write("<a href='http://community.csdn.net/'>community.csdn.net</a>")
else
response.write("<a href='http://www.baidu.com'>www.baidu.com</a>")
end if
%>
麻烦转换成PHP的谢谢了!
randomize()
r=rnd()
if r>0.5 then '显示几率
response.write("<a href='http://community.csdn.net/'>community.csdn.net</a>")
else
response.write("<a href='http://www.baidu.com'>www.baidu.com</a>")
end if
%>
麻烦转换成PHP的谢谢了!
echo rand()%2 ? "<a href='http://community.csdn.net/'>community.csdn.net</a>" : "<a href='http://www.baidu.com'>www.baidu.com</a>";
<?php
$rd = rand(0,100)/100;
echo $rd;
if($rd>0.5){
echo "<a href='http://community.csdn.net/'>community.csdn.net</a>";
}
else{
echo "<a href='http://www.baidu.com'>www.baidu.com</a>";
}
?>