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
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 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 )