php字符串排序

发布时间:2020-12-06 18:58:48 阅读:1134次

php中如何对字符串进行排序

字符串按照ASCII码顺序排序

假设字符串为hellotheworld123

$str = 'hellotheworld123';
$arr = str_split($str);
asort($arr);
$str = implode('',$arr);
echo $str;

结果为123deehhllloortw

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:php字符串排序 出自老鄢博客 | 欢迎分享