while循环,if语句错误[关闭]

For some reason when using this code it gives me a white screen, and I can't find the problem in it?

while ($monsterhp > 0 && $yourhp > 0) {

if ($pokemon4['speed'] => $row['speed']) {

$monsterhp = floor($monsterhp - $mydmg);

if($yourhp > 0) {
$yourhp = floor($yourhp - $monsterdmg);
}

}elseif ($pokemon4['speed'] < $row['speed']) {

$yourhp = floor($yourhp - $monsterdmg);

if ($monsterhp > 0) {
$monsterhp = floor($monsterhp - $mydmg);
}

}
}

you had an error in this operator: => (greater than or equal)

It should be like this: >=

You have a syntax error in second line of code... => will try to assign value to the array key, where >= means "greater or equal than".

Also, when you have white screen that's usually parser error, to see your errors you can check your php error log. The path depends on your system and server settings and it's defined in php.ini file. Usually though simple error_reporting(E_ALL) inside your php file works fine and throws errors on the screen. It's strongly advised during development to have them ON so you can develop bug-free code. On the other hand, when on production server, turn them OFF to avoid exposing your code errors (if any) to the public.

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);