Paul's right, but a heads up. Strpos does not return a -1 like indexOf does when the substring is not found.
Note how the PHP manual describes whether you really found the substring or not (remembering that string operations ARE zero-based in PHP):
// in PHP 4.0b3 and newer:
$pos = strpos ($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}
// in versions older than 4.0b3:
$pos = strpos ($mystring, "b");
if (is_string ($pos) && !$pos) {
// not found...
}
Pretty funky, eh? Dave
===========================================
http://badblue.com
Free small footprint web server for Windows
P2P file-sharing, PHP, wireless apps & more