<?php
$iphone = '手机';
var_dump($iphone);
$a = '111';
unset($a);
?>
问题1:为什么输出是 string(6) "手机" 其中6是什么意思?怎么不是输出sting(手机)?
问题2:unset($iphone); 输出是空白,不是NULL吗
数据分析师2017-10-01 00:33:56
PHP entry-level questions: var_dump($iphone); and unset($a); output-PHP Chinese website Q&A-PHP entry-level questions: var_dump($iphone); and unset($a); output-PHP Chinese website Q&A
Let’s watch and learn.
南2017-09-21 21:06:26
var_dump:
This function displays structural information about one or more expressions, including the type and value of the expression. Arrays will expand values recursively, showing their structure through indentation.
null and blank, give an example to understand that unset() returns blank, both have the meaning of releasing memory
<?php
$a = array(
'a'=> 1,
'b'=>2
);
$b = array(
'a'=>1,
'b'=>2
);
unset($a['a']);
$b['a'] = null;
print_r($a);
print_r($b);
?>
Print result :Array ( [b] => 2 ) Array ( [a] => [b] => 2 )