PHP \ xf0 represents 0xF0?

5

If \xF0 represents a hex as well as 0xF0 , why are their output different?

echo "\xF0";
echo 0xF0;

I actually do not find any information about this \xF0 notation in the PHP manual.

    
asked by anonymous 26.10.2018 / 20:06

1 answer

5

They are different things. The first example is a string, and the \xHH fault notation represents the one-character hexadecimal code. The 0xF0 is an integer number, represented as literal hexadecimal (that is, base 16). Then in the first case the hexadecimal code represents a character of a table, while in the second case it is simply a number.

    
26.10.2018 / 20:34