[英]Can't combine strpos and !empty in PHP, why?
I have two lines in PHP that if I combine causes my page to stop loading...Unfortunately, I have no error message using error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);
我在PHP中有两行,如果我合并导致我的页面停止加载...不幸的是,我没有使用
error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);
错误消息error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);
error_reporting(E_ALL | E_STRICT); ini_set('display_errors', true);
, and nothing in my apache error.log file. ,我的apache error.log文件中没有任何内容。
this works: 这工作:
$user_setup = strpos($_SESSION['user'], "@");
if (!empty($user_setup)) {....
But, this does not: 但是,这不是:
if (!empty(strpos($_SESSION['user'], "@"))) {....
Is there something about the strpos
function causing this to not work? strpos
功能有什么原因导致它不起作用吗?
Thanks for your help! 谢谢你的帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.