How to escape a < sign that is in text?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmj07
    New Member
    • Aug 2008
    • 55

    How to escape a < sign that is in text?

    I have a text output that could be like:

    hello < there

    but when displayed it cuts out the part after the < sign so it just displays the hello

    what is a way around this of escaping the < sign and showing the full message?

    Many thanks in advance.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by dmj07
    I have a text output that could be like:

    hello < there

    but when displayed it cuts out the part after the < sign so it just displays the hello

    what is a way around this of escaping the < sign and showing the full message?

    Many thanks in advance.
    <, >, and many other characters have special meanings in HTML. Check out htmlspecialchar s().

    Comment

    • maheswaran
      New Member
      • Mar 2007
      • 190

      #3
      You can use with in "" like echo "hello < there"

      Comment

      Working...