简单教程
提交运行
代码编辑器:
<?php $age=array("11"=>"27","11a"=>"29","12a"=>"37","Bill"=>"35","Steve"=>"37","Peter"=>"43"); echo '排序前:<br/>'; foreach($age as $x=>$x_value) { echo "Key=" . $x . ", Value=" . $x_value; echo "<br>"; } ksort($age); echo '<br/>排序后:<br/>'; foreach($age as $x=>$x_value) { echo "Key=" . $x . ", Value=" . $x_value; echo "<br>"; } echo '<p>PHP 基础教程 - 简单教程(www.twle.cn)</p>';
运行结果: