Home > Backend Development > PHP Tutorial > php 二维数组

php 二维数组

WBOY
Release: 2016-06-23 14:16:56
Original
1595 people have browsed it

二维数组 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";
Copy after login


直接贴代码 运行结果是 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";
Copy after login

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

我的运行结果是这样的:

wancheng fuzhi 1111ArrayArray
Copy after login

我使用本地的php环境进行测试的,php版本5.4
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template