You are here: htmlentities is not working for me « PHP Programming Language « IT news, forums, messages
htmlentities is not working for me

Posted by jl on 12/17/93 11:57

>From the php manual I copied and pasted this example:

<?php
$str = "A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str);

// Outputs: A &#039;quote&#039; is &lt;b&gt;bold&lt;/b&gt;
echo htmlentities($str, ENT_QUOTES);
?>

However, when I run it in my browser, the output is wrong:

A 'quote' is <b>bold</b>A 'quote' is <b>bold</b>

the < is not converted to &lt (no conversion is taking place)

Is there a configuration that would disable htmlentities?
Does anyone have any idea as to what would cause htmlentities to not
work?

Thanks!
jl

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация