下一篇 » « 上一篇

ksort

作者:semirock    时间:2008-06-27    来源:http://444p.com    点击:1008    本文共1篇文章 字体:[ ]

ksort

<HTML>
<HEAD>
<TITLE>ksort</TITLE>
</HEAD>
<BODY>
<?
$colors = array("red"=>"FF0000",
"green"=>"00FF00",
"blue"=>"0000FF");

// sort an array by its keys
ksort($colors);

// print out the values
for(reset($colors); $index=key($colors); next($colors))
{
print("$index : $colors[$index] <BR>\n");
}
?>
</BODY>
</HTML>
发表评论
密码: (游客不需要密码)
记住我【Alt+S 或 Ctrl+Enter 快速提交】

搜索工具


《PHP函数》点击排行