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

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

jl wrote:
> >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

I figured it out. The browser was reconverting the string.

 

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

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