php专区

 首页 > php专区 > PHP应用 > php函数大全 > php 数组的用法

php 数组的用法

分享到:
【字体:
导读:
          Array ( [0] => Array ( [userid] => 1 [username] => 刘振鹏 [status] => 0 [userpwd] => ) [1] => Array ( [userid] => 2 [username] => 刘鹏飞 [status] => 0 [userpwd] =>

 

Array ( [0] => Array ( [userid] => 1 [username] => 刘振鹏 [status] => 0 [userpwd] => ) [1] => Array ( [userid] => 2 [username] => 刘鹏飞 [status] => 0 [userpwd] => ) [2] => Array ( [userid] => 3 [username] => 刘朋 [status] => 0 [userpwd] => ) [3] => Array ( [userid] => 4 [username] => admin [status] => 0 [userpwd] => ) [4] => Array ( [userid] => 11 [username] => admin [status] => 0 [userpwd] => ) [5] => Array ( [userid] => 12 [username] => admin [status] => 0 [userpwd] => ) [6] => Array ( [userid] => 13 [username] => liuzp [status] => 0 [userpwd] => ) [7] => Array ( [userid] => 14 [username] => lzp [status] => 0 [userpwd] => ) )

下面是对二维数组的用法
for($i=0;$i{
for($j=0;$j  {
     echo $array[$j][userid];
  }
}
因为它是个多维数组,一般用
foreach ($arr as $key => $value) {
    echo "Key: $key; Value: $value
n";
}
($array[$i]);$j++)
($array);$i++)

分享到:
php chown 函数
定义和用法该chown ( )函数是用来改变指定文件的权限。 在返回TRUE和FALSE成功的失败。 语法chown(file,owner)   定义和用法 该chown ( )函数是用来改变指定文件的权限。 在返回TRUE和FALSE成功的失败。 语法 chown(file,owner) Parameter Description file 必需的。指定...
PHP中文函数连载(一)
  函数Abs() 描述: mixed abs (mixed number); Returns the absolute value of number. If the argument number is float, return type is also float, otherwise it is int(返回所输的数字的绝对值,浮点型返回浮点型,其他返回整型) 函数Acos() 描述: float acos (float arg); Returns the arc cosine of arg ...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……