PHP : No readable output, when I use the less than symbol, in combination with the var_dump() function

100 Views Asked by At

Why is in PHP this code snippet returning no readable output,

$string = "<Hello World!";
var_dump($string);

but this

$string = ">Hello World!";
var_dump($string);

is returning

">Hello World!"
1

There are 1 best solutions below

0
On BEST ANSWER

It's seems that you dump this var in html file and browser parse this:

"<Hello World!"

as

<hello world!"="" <="" body="">
</hello>

This snippet

$string = ">Hello World!"

can't be parsed as html tag, so you can get readable output.