I looked at the other question, but the answer is not true for me.
$text:
(string:104) “The diamond cannot be polished without friction, nor the man perfected without trials.” Chinese Proverb
Yet…
strpos($text, '“')
=== false, upon inspection.
Same with:
strpos($text, "“")
strpos($text, "\“")
strpos($text, '\“')
Ideas?
EDIT: it is a $_POST variable grabbed from a textarea, if that makes a difference. The value is precisely
“The diamond cannot be polished without friction, nor the man perfected without trials.” Chinese Proverb
Perhaps the quote character
“found in the text is a different Unicode character to the one you are specifying in your code. Alternatively, perhaps the text is in a different character encoding to your code. Check what character set you are viewing the output in, and see whether it matches the encoding of the PHP script.Edit:
Find out what
str_ord()outputs for'“'and for the first few characters of your textarea-string. If it outputs different numbers then you have a character encoding issue.