Connecting Tech Pros Worldwide Help | Site Map

htmlentities

  #1  
Old July 17th, 2005, 03:35 AM
tco
Guest
 
Posts: n/a
Hi all,

I'm searching a reverse function for htmlentities.... i couldn't find
anything in the manual and over forums :-/
does anyone have an idea ?

many thanks in advance,
--
tco


  #2  
Old July 17th, 2005, 03:35 AM
Pedro Graca
Guest
 
Posts: n/a

re: htmlentities


tco wrote:[color=blue]
> I'm searching a reverse function for htmlentities.... i couldn't find
> anything in the manual and over forums :-/
> does anyone have an idea ?[/color]

Very well hidden after the charsets table, you can find

<quote src="http://www.php.net/htmlentities">
If you're wanting to decode instead (the reverse) you can use
html_entity_decode().
</quote>

and you can find more about html_entity_decode @
http://www.php.net/html_entity_decode


#v+
<?php
$x = 'test <html parm="val"/> test';

$y = htmlentities($x);
$z = html_entity_decode($y);

echo "x=$x\ny=$y\nz=$z\n";
?>
#v-

The output is (I run PHP in command-line mode):
x=test <html parm="val"/> test
y=test &lt;html parm=&quot;val&quot;/&gt; test
z=test <html parm="val"/> test
-
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
  #3  
Old July 17th, 2005, 03:35 AM
steven mestdagh
Guest
 
Posts: n/a

re: htmlentities


tco <tco@nospam.org> wrote:[color=blue]
> Hi all,
>
> I'm searching a reverse function for htmlentities.... i couldn't find
> anything in the manual and over forums :-/[/color]

from the manual:

html_entity_decode() is the opposite of htmlentities() in that it
converts all HTML entities to their applicable characters from string.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
just wondering... htmlspecialchars vs htmlentities mijn naam answers 8 September 13th, 2008 07:25 PM
mysql_real_escape_string/htmlentities issue matthud@gmail.com answers 2 February 18th, 2007 03:35 AM
htmlentities is not working for me jl answers 3 August 26th, 2006 06:25 PM
htmlentities & charencoding Taras_96 answers 7 July 12th, 2006 12:15 AM