<?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?/>";
?>???這個輸出的結(jié)果是:
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?/>";
?>??這個輸出的結(jié)果是:
123
-123
0123
0x123
賦值運(yùn)算符后面的都是變量值?為啥不一樣呢
2016-03-17
因為“0x123”這是輸出字符串,它會照樣輸出里面填寫的內(nèi)容,而第一種是數(shù)值,不用加“”
2016-03-17
加雙引號輸出的是字符串的內(nèi)容