<?php $data_int1 = 123; echo $data_int1; echo "<br />"; $data_int2 = -123; echo $data_int2; echo "<br />"; $data_int3 = 0123; echo $data_int3; echo "<br />"; $data_int4 = 0x123; echo $data_int4; echo "<br />"; ?> 这个输出的结果是: 123 -123 83 291 <?php $data_int1 = "123"; echo $data_int1; echo "<br />"; $data_int2 = "-123"; echo $data_int2; echo "<br />"; $data_int3 = "0123"; echo $data_int3; echo "<br />"; $data_int4 = "0x123"; echo $data_int4; echo "<br />"; ?> 这个输出的结果是: 123 -123 0123 0x123 赋值运算符后面的都是变量值 为啥不一样呢
因为“0x123”这是输出字符串,它会照样输出里面填写的内容,而第一种是数值,不用加“”
加双引号输出的是字符串的内容