1
lizheming 2014-06-30 10:53:05 +08:00
如果是PHP的话,这种情况下完全不需要判断吧?
|
2
kmvan OP 为啥不需要判断呢?
|
3
issac 2014-06-30 11:57:13 +08:00
直接赋值,PHP会根据情况创建数组的:
$cache_post_metas['post-1']['thumbnail']['thumb'] = 'http://xxx.com/xx.jpg'; 如果是要输出,就需要先判断 if(isset($cache_post_metas['post-1']['thumbnail']['thumb'])) { echo $cache_post_metas['post-1']['thumbnail']['thumb']; } |
4
kmvan OP $cache_post_metas['post-1']['thumbnail']['thumb'] = 'http://xxx.com/xx.jpg';
这样子的话,php会提示下标['post-1']未定义的警告哦。。 |