Home  >  Article  >  Backend Development  >  php 二维数组

php 二维数组

WBOY
WBOYOriginal
2016-06-23 14:16:561585browse

二维数组 PHP

       $name[0]= array("1"=>"1111","2"=>"2222","3"=>"3333"  );       if (isset($name[0]["1"]))        {                echo "wancheng fuzhi ";                echo $name[0][1].$name[0].$name[0];        }        else                echo "fffffffffff";


直接贴代码 运行结果是  fffffffffff 就像是二维数组赋值赋不进去一样 求助

回复讨论(解决方案)

前面加
$name = array();

前面加
$name = array(); 瞬间就懂了 谢谢

       $name[0]= array("1"=>"1111","2"=>"2222","3"=>"3333");       if (isset($name[0][1]))        {                echo "wancheng fuzhi ";                echo $name[0][2].$name[0].$name[0];        }        else                echo "fffffffffff";

php版本?至少我的5.3.2是运行正常的

我的运行结果是这样的:

wancheng fuzhi 1111ArrayArray

我使用本地的php环境进行测试的,php版本5.4

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn