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.
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.
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.