关于PHP变量定义
今天在写代码的时候遇到一个非常有意思的事情
current_index = nav-menus;
在定义一个变量的时 候定义语法写错了 没加分号
报错后 我在打印变量的时候 竟然会是下面的情况
echo $current_index ;
if($current_index == 'index'){
echo "string";
}else{
echo "123";
}
if($current_index == '1'){
echo "string";
}else{
echo "123";
}
//== >0 string 123
第一个输出0 第二个和第三个布尔值竟然不一样
!