xiaozi 2014-11-21 22:12:00

php 中,判断数组的键是否存在时,应使用`array_key_exists`而不是`isset`

<?php

$arr = [
	'iamnull' => null,
];

var_dump(isset($arr['iamnull']));

var_dump(array_key_exists('iamnull', $arr));

评论

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.137.1. UTC+08:00, 2024-11-21 20:44
浙ICP备14020137号-1 $访客地图$