Answer the question
In order to leave comments, you need to log in
How to remove special characters like &nbs..?
I am getting an html string from the database. It is necessary to remove all tags and display to the user.
This is how I clean the variable: htmlentities(strip_tags($text), ENT_QUOTES, "UTF-8");
After $text = json_encode($text);
The & nbsp; tags remain in the string. – etc.
How to properly clean them all? str_replace doesn't seem like an option to me. I want to clear all the tags at once!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question