Re: [PHP] replace special chars
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? If only the PHP gods would bless us with a function such as htmlspecialchars() or maybe even htmlentities()... what a great world it would be... ;) Take a look at the manual pages and they convert different character sets and handle quotes differently based upon the second parameter. http://us2.php.net/htmlentities http://us2.php.net/htmlspecialchars -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] replace special chars
2003-11-05 kl. 16.07 skrev Pavel Jartsev: Try "htmlspecialchars()" and/or "htmlentities()". htmlentities() did it best! Thanks, /.v -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] replace special chars
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: 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] replace special chars
[snip] Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? [/snip] http://www.php.net/str_replace -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] replace special chars
Are there any good function to replace special characters, for example double qoutes, with something that are more html-safe? For example: 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php