- Forums
- PHP
- How To Convert Characters To HTML Entities With PHP Function Script Code
this page will teach you how to convert special HTML characters inot HTML entities with PHP function for your script. i will give you example with PHP code. you will see converting HTML characters is easy with this tutorial [1032], Last Updated: Sat May 18, 2024
webune
Mon May 28, 2007
2 Comments
1721 Visits
ok, so today i wanted to change a character into special html characters. some examples are when users enter their name is a foreign language other than english. some characters have accents and some search engines don't like that and some validation tools show as error:
so lets say for example i have this name:
Toledão
what you see is looks like toledafaeo right, well, that's how the browser shows it to you, but if you look at this page HTML code, you will see that it looks something like this:
Toledão
well, how do you do it. PHP is great for this.
if you dont have PHP yet on your website, i recommend you use our friends at www.webune.com, they have great service in hosting packages.
so if you have PHP, lets continue.. lets follow the example with this name so to display it properly i would use the htmlentities() function and this how my script would look like:
CODE:
<?
echo htmlentities("Toledão");
?>
OUTPUT:
Toledão
hope this helps..
if you want more information visit php.net at:
http://us.php.net/htmlentities
im a websmaster and i will save this infor
this is a keepr
https://www.wallpaperama.com/forums/how-to-convert-characters-to-html-entities-with-php-function-script-code-t1415.html