这篇文章主要为大家详细介绍了php关联数组用法示例,具有一定的参考价值,可以用来参考一下。
对php关联数组使用范例演示感兴趣的小伙伴,下面一起跟随四海网的小编两巴掌来看看吧!
/**
* php关联数组使用范例演示
*
* @param
* @arrange 512-笔记网: www.q1010.com
**/
/* First method to associate create array. */
$salaries = array(
"mohammad" => 2000,
"qadir" => 1000,
"zara" => 500
);
echo "Salary of mohammad is ". $salaries['mohammad'] . "<br />";
echo "Salary of qadir is ". $salaries['qadir']. "<br />";
echo "Salary of zara is ". $salaries['zara']. "<br />";
/* Second method to create array. */
$salaries['mohammad'] = "high";
$salaries['qadir'] = "medium";
$salaries['zara'] = "low";
echo "Salary of mohammad is ". $salaries['mohammad'] . "<br />";
echo "Salary of qadir is ". $salaries['qadir']. "<br />";
echo "Salary of zara is ". $salaries['zara']. "<br />";
/*** 来自四海网(www.q1010.com) ***/
输出结果如下: Salary of mohammad is 2000 Salary of qadir is 1000 Salary of zara is 500 Salary of mohammad is high Salary of qadir is medium Salary of zara is low
本文来自:http://www.q1010.com/173/1092-0.html
注:关于php关联数组用法示例的内容就先介绍到这里,更多相关文章的可以留意四海网的其他信息。
关键词:关联数组
四海网收集整理一些常用的php代码,JS代码,数据库mysql等技术文章。