PHPで次の問題があります。文字 (文字列) を 16 進値と比較したい場合は、次のコード例を参照してください。
// some key defined in some other application. I only can use KEY1
define("KEY1", 0x31);
// the test value
$sValue = '1';
// the comparison which I would like not to modify
print ($sValue == KEY1) ? "true" : "false";
0x31文字 ' ' である 49 10 進数を表すので1、true. 代わりにfalse. 以外のものを使用せずにそれを正しくする方法はKEY1? の種類sValueが間違っているのではないでしょうか?