Um, thats a funky if() you have there...
rand() returns an integer value. So you'd want something like:
$randnumber = rand(1,2);
This will put a random value of either 1 or 2 into $randnumber.
If statements are
if( [condition] )
{
true
}
else
{
false
}
So I think you'd want:
if($sugtimes == $randnumber)
{
// do something if they're equal
}
else // this else and all the code after it is optional
{
// do something else if they're not equal
}
Notice the '==' which is a comparison operator. You can get fancy and swap $randnumber with rand(1,2) and that would work just fine. I wrote it the way I did in an attempt to keep it clear...