Hi there [htmlspecialchars]Does nothing

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

$new = htmlspecialchars("<a href=", ENT_QUOTES, 'ISO-8859-15');
echo $new;


<a href

Instead of :

&lt; a href

I added the character set since this is a computer in Europe.

The PHP is the Win32 5.1.2

Thanks for your help

Re: Hi there [htmlspecialchars]Does nothing

universalbitmapper wrote:
Quoted text here. Click to load it

It outputs &lt;a href=, if you view it with a browser it display's  <a href,
instead of making an 'a' element. View your source.

If you want to display you special characters like &lt; in a browser: either
double yoiu htmlentities/htmlspecialchars (so,
htmlspecialchars(htmlspecialchars($string))), or
str_replace('&','&amp;',$string) after you have replaced ther characters.

Rik Wasmus

[SOLVED]Re: Hi there [htmlspecialchars]Does nothing

Rik wrote:
Quoted text here. Click to load it

Hi Rik,

I have done like you wrote, indeed I see &+lt+; if I select "source" in

Many thanks


Site Timeline