0

Hi
I am trying to add a text in php where a "<" and ">" sign exits in a string, however when I view the string I get '%3C' and '%3E' respectively.

I tried most of the php functions related to html entities such as:
htmlentities
html_entity_decode
htmlspecialchars

I viewed the html signs table but never found that '<' is equivalent to '%3C' or '>' is equivalent to '%3E'. But rather I found they are equivalent to '&lt;' and '&gt;' respectively.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by khr2003
0

thank you for the reply. it was really helpful. However, it seemed it did not work on my local server. I tried couple of online decoder and they worked. So any idea why it did not work on the local server?

0

I also tried rawurlencode but with no luck.

Basically I put this code in single page:

<?php
 $img  = "<img border=0 src=\"<#themepath#>/close.gif\">";
			 $re = urldecode($img);
			 echo $re;
			 ?>

And I got the same results. However when I changed ' < > ' to this ' { }' The first ' { ' was displayed as ' %7B ' while ' } ' was displayed normally, ie without any change.

why is this happening?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.