-1

This is a weird issue.

I just trying to print/create a string like below :

sort="name<string>"

so I just do

echo 'sort="name<string>"';

however, it seems that PHP store it as :

sort="name"

What do I miss?

Rudy
  • 6,720
  • 10
  • 46
  • 81

2 Answers2

0

Try this:

echo 'sort="name&lt;String&gt;"';
Sergey
  • 5,169
  • 23
  • 36
0

Try this...

echo htmlspecialchars('sort="name<string>"', ENT_QUOTES, 'UTF-8');
Ja͢ck
  • 166,373
  • 34
  • 252
  • 304
Ashwini Agarwal
  • 4,758
  • 2
  • 41
  • 58