php 简洁数组的用法示例

前端之家收集整理的这篇文章主要介绍了php 简洁数组的用法示例前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
PHP简洁数组的用法感兴趣的小伙伴,下面一起跟随编程之家 jb51.cc的小编两巴掌来看看吧!

/**
 * PHP简洁数组的用法
 *
 * @param 
 * @arrange 512-笔记网: www.jb51.cc
 **/
Array ( [] => Array ( [userid] => [username] => 刘振鹏 [status] => [userpwd] => ) [] => Array ( [userid] => [username] => 刘鹏飞 [status] => @H_403_12@[userpwd] => ) [] => Array ( [userid] => [username] => 刘朋 [status] => [userpwd] => ) [] => Array ( [userid] => [username] => admin [status] => [userpwd] => ) [] => Array ( [userid] => [username] => admin [status] => @H_403_12@[userpwd] => ) [] => Array ( [userid] => [username] => admin [status] => [userpwd] => ) [] => Array ( [userid] => [username] => liuzp [status] => [userpwd] => ) [] => Array ( [userid] => [username] => lzp [status] => [userpwd] => ) )
/***   来自编程之家 jb51.cc(jb51.cc)   ***/

下面是对二维数组的用法

/**
 * PHP简洁数组的用法
 *
 * @param 
 * @arrange 512-笔记网: www.jb51.cc
 **/
for($i=;$i{
for($j=0;$j{
echo $array[$j][userid];
}
}
/***   来自编程之家 jb51.cc(jb51.cc)   ***/

因为它是个多维数组,一般用

/**
 * PHP简洁数组的用法
 *
 * @param 
 * @arrange 512-笔记网: www.jb51.cc
 **/
foreach ($arr as $key => $value) {
echo "Key: $key; Value: $value
n";
}

原文链接:https://www.f2er.com/php/528256.html

猜你在找的PHP相关文章