how to convert characters to HTML entities with PHP Function Script Code
RegisterLogin
how to convert characters to HTML entities with PHP Function Script Code
Post Description: how to convert characters to HTML entities with PHP Function Script Code
Tags: how, to, convert, characters, to, HTML, entities, with, PHP, Function, Script, Code
This Post Was Posted On Jun 09, 2010 By webune #1245
Post Description: how to convert characters to HTML entities with PHP Function Script Code
Tags: how, to, convert, characters, to, HTML, entities, with, PHP, Function, Script, Code
This Post Was Posted On Jun 09, 2010 By webune #1245
how to convert characters to HTML entities with PHP Function Script Code by webune
so lets say for example i have this name:
El Niño
what you see is looks like El Niño 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:
El Niñ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("El Niño");
?>
echo htmlentities("El Niño");
?>
OUTPUT:
El Niño
HTML CODE:
niño
hope this helps..
Description
string htmlentities ( string $string [, int $quote_style [, string $charset]] )
This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.
Like htmlspecialchars(), the optional second quote_style parameter lets you define what will be done with 'single' and "double" quotes. It takes on one of three constants with the default being ENT_COMPAT:
if you want more information visit php.net at:
http://us.php.net/htmlentities
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
janki
#4046 1
el niño does it work if i use htmlspecialchars?
Jun 09, 2010 Reply Report abuse
ToledÃÆ’Æ
#1681 2
nice, so how are you goin to display it if i enter: toledÃÆ’Æâ€™Ã‚£o on my comments?
May 28, 2007 Reply Report abuse
©2011 Webune Forums - Mon Dec 19, 2011 4:08 am
Powered by: Webune Forums V3
Powered by: Webune Forums V3