mb_strpos and special characters
Posted: Wed Nov 30, 2011 9:19 pm
I have an interesting problem related to mb_strpos and special characters. Here is my code:
<?php
$string = "status=�http://www.bestbuy.com�";
$temp = mb_strpos($string,"�");
?>
In this case, mb_strpos is always returning false. I have tried adding 16 bit encoding like this:
$temp = mb_strpos($string,"�",0,"UTF-16");
and
$temp = mb_strpos($string,"�",0,"auto");
The string with the special characters are throughout my database and I'm trying to write a script that converts "�" to a single quote.
Any help is appreciated.
<?php
$string = "status=�http://www.bestbuy.com�";
$temp = mb_strpos($string,"�");
?>
In this case, mb_strpos is always returning false. I have tried adding 16 bit encoding like this:
$temp = mb_strpos($string,"�",0,"UTF-16");
and
$temp = mb_strpos($string,"�",0,"auto");
The string with the special characters are throughout my database and I'm trying to write a script that converts "�" to a single quote.
Any help is appreciated.