so I have a string that goes like this:
$string = "This is a test string. It has characters like these: '";
Is there a php function that transforms these to their correspondent character, in my example the desired output would be:
print $string
// OUTPUT: This is a test string. It has characters like these: '
yes there is:
htmlspecialchars_decode($string, ENT_QUOTES);
not sure about the specific '
char, as far as I know htmlspecialchars
(with ENT_QUOTES
flag) convert an apostrophe (') to '
(with a leading zero)
so the exact behavior on '
worth checking
EDIT: I made the test and it does work :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With