php 영문 문자열 알파벳 정렬
페이지 정보
작성자
본문
알파벳 기준으로 영문을 정렬할때 사용하는 방법이다.
function strSort($str) {
$arr = str_split($str);
sort($arr);
return implode('', $arr);
}
$str = 'hello world';
echo strSort($str);
----- Output -----
dehllloorw
댓글목록
등록된 댓글이 없습니다.