Re: replace special chars
| From: | Pavel Jartsev | Date: | Wed, 05 Nov 2003 15:07:57 +0000 |
| Subject: | Re: replace special chars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-168566@lists.php.net to get a copy of this message | ||
Victor Spång Arthursson wrote:
Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe?
For example:
<option
label="Dekora Marilet "Amerikano" (9859)"
value="98590">
</option>
The above is generated with PHP and fetched from a database (postgresql). I'ld like to have the double qoutes replaced with "something else" ;) There could be other strange characters as well that needs to be replaced, so some sort of universal function would be really nice to get tips on… ;)
Sincerely
Victor
Try "htmlspecialchars()" and/or "htmlentities()".
--
Pavel a.k.a. Papi