Php If else isn't working
This question already has an answer here:
$gameum['status'] = '0' // assigns the value '0' to $gamenum['status']
($gameum['status'] == '0') // compares the two values
Your if
statement should be
if($gameum['status'] == '0' ) {
and if you are looking for strict
check , i suggest you do
if($gameum['status'] === '0' ) {
Your are Assigning $gameum['status']
to 0
, if is a conditional statement add double equal ==
to if condition, change
if($gameum['status'] = '0' ) {
with
if($gameum['status'] == '0' ) {
Single equal =
Assigns the value.
Double equal ==
Compare value, == does not care about the data types when comparing.
Triple equal ===
The data types are checked to make sure the two vars/objects/whatever
are using the same type.
上一篇: PHP执行头文件:位置,无论IF语句参数
下一篇: Php如果其他人不工作