"United States", "IN" => "India", "DE" => "Germany", "ES" => "Spain");ksort(">
当前位置:Gxlcms > PHP教程 > PHP函数Ksort()通过关键字对数组进行排序的具体方式介绍_PHP教程

PHP函数Ksort()通过关键字对数组进行排序的具体方式介绍_PHP教程

时间:2021-07-01 10:21:17 帮助过:23人阅读

我们在学习Listing C的具体代码如下:

  1. php
  2. $data = array("US" => "United States",
    "IN" =
    > "India", "DE" => "Germany", "ES" =>
    "Spain");ksort($data); print_r($data);
  3. ?>

它的输出结果如下:

Array ([DE] => Germany

[ES] => Spain

[IN] => India

[US] => United States

)

通过上面例子的介绍,希望大家能清楚PHP函数Ksort()的具体使用。


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/446350.htmlTechArticle我们在学习 Listing C的具体代码如下: ? php $ data = array ("US"= "UnitedStates", "IN"= "India","DE"= "Germany","ES"= "Spain");ksort($data);print_r($data); ? 它的输出...

人气教程排行