php关联数组与索引数组及其显示方法

yipeiwu_com6年前PHP代码库

数据

username password 
test 123456

关联数组:

 mysql_fetch_assoc()
 array([username]=>'test',[password]=>'123456')

索引数组:

mysql_fetch_array()
array([0]=>'test',[1]=>'123456')

var_export()

array ( 0 => 1, 1 => 'a', 2 => 'hello', )

var_dump()

array(3) { [0]=> int(1) [1]=> string(1) "a" [2]=> string(5) "hello" }

以上这篇php关联数组与索引数组及其显示方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持【宜配屋www.yipeiwu.com】。

相关文章

php简单浏览目录内容的实现代码

如下所示:复制代码 代码如下:<?php$dir = dirname(__FILE__);$open_dir = opendir($dir);echo "<table bor...

php将文本文件转换csv输出的方法

本文实例讲述了php将文本文件转换csv输出的方法。分享给大家供大家参考。具体实现方法如下: 这个类提供了转换成固定宽度的CSV文件,快速,简便的方法,它可将SplFileObject用...

解析PHP计算页面执行时间的实现代码

如下所示:复制代码 代码如下:<?php  $t = new executeTime;  phpinfo();  class executeTime{...

php从身份证获取性别和出生年月

话不多说,请看代码: //通过身份证号查询出性别与生日 $birth = strlen($idcard)==15 ? ('19' . substr($idcard, 6,...

PHP_NETWORK_GETADDRESSES: GETADDRINFO FAILED问题解决办法

在做FTP资料采集的时候,需要用到一个PHP函数ftp_connect,这个函数是建立一个新的 FTP 连接,如果成功返回一个连接标识,失败则返回 FALSE.ftp_connect()...