Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Be pavadinimo

Parašė ibodom· 2008 Vas. 23 16:02:16
#4

Gal taip?
$banners = array('txt1','txt2','txt2','txt4','txt6=5',);
$cc = count($banners) ;
$cl = $cc-1;
$rand = rand(0,$cl);
$rand2 = rand(0,$cl);
$rand3 = rand(0,$cl);

if($rand!=$rand2 or $rand!=$rand3 or $rand2!=$rand3)
{
echo"$banners[$rand]";
echo"$banners[$rand2]";
echo"$banners[$rand3]";
}
else
{
$rand = rand(0,$cl);
$rand2 = rand(0,$cl);
$rand3 = rand(0,$cl);

echo"$banners[$rand]";
echo"$banners[$rand2]";
echo"$banners[$rand3]";
}



Redagavo ibodom· 2008 Vas. 23 16:02:48