View Single Post
Old 06-01-2014, 03:04 PM  
pornmasta
Too lazy to set a custom title
 
pornmasta's Avatar
 
Join Date: Jun 2006
Posts: 19,336
Quote:
Originally Posted by blackmonsters View Post
Yeah and when you do a false test with a number, say "-1" then the if statement evals to true when false is returned from stripos.

<?
$string = "ello";

if (stripos($string,'hello') != -1 ) {
echo "True";
}
else {
echo "false";
}
?>

Like I said, the correct way to do it is !== false
There is no reason for a string position to be negative.
pornmasta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote