I know, I had the same prob once. If strpos could find the needle, it returns "", otherwise it returns "0". So I guess you could check like this:
$pos = strpos($haystack, $needle);
if ($pos == "0") {
// Blah blah bleh
}
A safer way that I often use is this:
// Put any one character before the $haystack string
$pos = strpos("a" . $haystack, $needle);
if ($pos == "1") {
echo "Found at position 1.";
}
Now this returns false when not found, otherwise the position + 1. Just $pos-- for the real position.
Greetz,
Vincent Driessen
Venlo, The Netherlands