echo strpos($string, "BlackBerry"); // displays '0'
echo strpos($string, "BBlackBerry"); // displays 'nothing', NULL?
I tried to comapre it with 'NULL', still, it not yields!!
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()
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.