I have a php script. The meaning is when you see three of the same images you see a echo you win.
But how can I write the echo img of the three variables?
can someone help me?
thanks in advance.
my code is:
Code: Select all
function jackpot(){
$a=array("1.jpg", "2.jpg", "3.jpg");
$cur_rndNumA=mt_rand(0,count($a)-1);
$cur_rndNumB=mt_rand(0,count($a)-1);
$cur_rndNumC=mt_rand(0,count($a)-1);
[b]echo "<img src=\"$a[$cur_rndNumA]\" "\$a[$cur_rndNumB]\" "\$a[$cur_rndNumC]\" ">" "; //HOW WRITE I THIS?[/b]
if($a[$cur_rndNumA] == "1.jpg" && $a[$cur_rndNumB] == "1.jpg" && $a[$cur_rndNumC] == "1.jpg" ){
echo "you win";
}
if($a[$cur_rndNumA] == "2.jpg" && $a[$cur_rndNumB] == "2.jpg" && $a[$cur_rndNumC] == "2.jpg" ){
echo "you win";
}
if($a[$cur_rndNumA] == "3.jpg" && $a[$cur_rndNumB] == "3.jpg" && $a[$cur_rndNumC] == "3.jpg" ){
echo "you win";
}
}
jackpot($a);