Are there different types of double quotes in utf-8 (PHP, str_replace)?

In PHP 5.3, I am trying to replace double quotes in a string as such:

$bar = str_replace('"','\'',$foo); 

But some quotes that are stored in utf8-Database are not replaced, although they look completely normal:

"Some text"

Are there different types of characters I should look for? If so, what are they?

+7
php quotes utf-8
source share
3 answers

There are many characters that look like quotation marks; most of them are used infrequently. The ones that are used most often are three:

 " U+0022 QUOTATION MARK " U+201C LEFT DOUBLE QUOTATION MARK " U+201D RIGHT DOUBLE QUOTATION MARK 

Some more rare are FULLWIDTH QUOTATION MARK, DITTO MARK, DOUBLE PRIME, DOUBLE PRIME QUOTATION MARK, etc. The Unicode.org "confusables" tool finds 15 characters similar to " .

Why don't you copy and paste the abusive character here so that we can identify it? Or you can use the HEX function to get the hexadecimal character encoding, which is another way to identify it.

+20
source share

Here is a list of all characters in Utf-8. It can be two single quotes.

0
source share

Ability to insert a quote using "numeric encoding of the HTML Unicode character"

http://www.utf8-chartable.de/unicode-utf8-table.pl?unicodeinhtml=dec&htmlent=1

Unicode code point does not work for me:

 " U+0022 QUOTATION MARK 

Alternatively this worked for me:

 " " QUOTATION MARK 
0
source share

All Articles