<?php $str = ‘abc0‘; echo strstr($str, ‘0‘);// 0 echo "\n"; echo strstr($str, ‘0‘) == ‘0‘;// 1 echo "\n"; echo strstr($str, ‘0‘) == false;// 1 注意两个等号和三个等号的区别,字符串0和false 强制转换后是一样的。 所以应用时 要使用 === echo "\n"; echo strstr($str, ‘0‘) === false;// false echo "\n";
时间: 2024-10-03 00:06:23