主页
PHP
PHP natsort() 函数
tryphp_func_natsort
运行 ❯
×
更改方向
保存代码
更改主题
<?php $temp_files = array("temp15.txt","temp10.txt", "temp1.txt","temp22.txt","temp2.txt"); sort($temp_files); echo "Standard sorting: "; print_r($temp_files); echo "
"; natsort($temp_files); echo "Natural order: "; print_r($temp_files); ?>