Reputation: 3823
i have encoded text with html elements. In this text i have single quotes and double quotes.
By PHP manual htmlspecialchars_decode($string, ENT_QUOTES) should decode all quotes. Double quotes have "034" code, but this now work.
My code:
$new = htmlspecialchars_decode('<a href="test'>Test</a>', ENT_QUOTES);
var_dump($new);
Result: string '<a href="test'>Test</a>' (length=28)
Why i get ""
" ? It should be double quotes
Upvotes: 2
Views: 852
Reputation: 9227
htmlspecialchars_decode
seems to work a little differently on older versions. Try html_entity_decode instead:
$new = html_entity_decode('<a href="test'>Test</a>', ENT_QUOTES);
Upvotes: 3