unset ( mixed var [, mixed var [, ...]])
unset() 销毁指定的变量。注意在 php 3 中,unset() 将返回 true(实际上是整型值 1),而在 php 4 中,unset() 不再是一个真正的函数:它现在是一个语句,这样就没有了返回值,试图获取 unset() 的返回值将导致解析错误
null 字节是变量为空 $t = ''; 变量有值,不过是空,isset()是true.
null 常数是 $t = null; 变量没有值,连空都不是,isset()是false.
<?php
$a = array(
'a' => 'a',
'b' => 'b'
);
$b = array(
'a' => 'a',
'b' => 'b'
);
$a['b'] = null;
unset($b['b']);
print('<pre class="brush:php;toolbar:false;">');
print_r($a);
print('<br />');
print_r($b);
print('
立即学习“PHP免费学习笔记(深入)”;
本文地址:
转载随意,但请附上文章地址:-)
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号