PHP入门问题:var_dump($iphone);和unset($a);输出
php实习生
php实习生 2017-02-26 17:00:33
0
2
3123

<?php

$iphone = '手机';

var_dump($iphone);

$a = '111';

unset($a);

?>

问题1:为什么输出是 string(6) "手机"       其中6是什么意思?怎么不是输出sting(手机)?

问题2:unset($iphone);  输出是空白,不是NULL吗

php实习生
php实习生

学习

reply all(2)
数据分析师

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.

南

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 )

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template