mb_strpos and special characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bmoore96
Forum Newbie
Posts: 1
Joined: Wed Nov 30, 2011 9:13 pm

mb_strpos and special characters

Post by bmoore96 »

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.
Post Reply