True.
echo strpos($string, "BlackBerry"); // displays '0'
echo strpos($string, "BBlackBerry"); // displays 'nothing', NULL?
I tried to comapre it with 'NULL', still, it not yields!!
so,
Quote:
quote:if(gettype(strpos($string, "BlackBerry"))=="integer")
echo "Blackberry web browser detected";
|
is fine as
strpos() returns string position in integer, and NULL? when it not finds..
Alternatively, you may use
preg_match() or
preg_match_all() functions for absolute-n-powerful matching; these are PHP functions supporting PCRE. It'll take you a while to learn regex ( if you don't know ), but it's a worthy stuff, to invest time.