Php htmlspecialchars returning empty string


Php htmlspecialchars returning empty string– Sometimes php htmlspecialchars function returns null(empty) string, this issue may be due some character unicode. I was facing the same issue and i passed utf-8 and ENT_QUOTES parameters and it worked for me.


Php htmlspecialchars returning empty string | Null String

To fix this issue you can pass the second and third parameters in htmlspecialchars function simply as below-

Php htmlspecialchars not working :

htmlspecialchars($string, ENT_QUOTES, 'utf-8')

After passing these parameters it fixed my issue and worked perfectly as expected.


Advertisements

Add Comment

📖 Read More