...

View Full Version : php strpos



gusblake
11-12-2006, 06:42 PM
Hi
when checking for the presence of a string using strpos, why does it return false if the string's at position 0?

CFMaBiSmAd
11-12-2006, 06:58 PM
It does not. It returns a zero. You must test using the === FALSE (equavalant to) operator.

Beagle
11-13-2006, 08:59 AM
in PHP, 0 evaluates to false, but retains it's type. So 0 == false is true but 0 === false is not. === is a type-strict value comparison.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum