PHP Strpos Function Special Notice

Sometime,  when you use strpos, it can't work as you expect, please refer to below:

 

Wrong Way

$pos = strpos($str, $status);
if($pos!==false)
{
.......                                            
}

 Right Way

$pos = strpos($str, "$status");
if($pos!==false)
{
.......                                            
}

 

 

你可能感兴趣的:(function)