-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
  • 7,008
  • 12
  • 50
  • 85

2 Answers2

0

Try this:

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

Try this...

echo htmlspecialchars('sort="name<string>"', ENT_QUOTES, 'UTF-8');
Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
Ashwini Agarwal
  • 4,828
  • 2
  • 42
  • 59