Connecting Tech Pros Worldwide Help | Site Map

htmlentities

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 02:35 AM
tco
Guest
 
Posts: n/a
Default htmlentities

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, 02:35 AM
Pedro Graca
Guest
 
Posts: n/a
Default 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, 02:35 AM
steven mestdagh
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.