php 영문 문자열 알파벳 역순 정렬
페이지 정보
작성자
본문
문자를 알바벳 순서 역순으로 정렬하는 방법이다.
function strRevSort($str) {
$arr = str_split($str);
rsort($arr);
return implode('', $arr);
}
$str = 'hello world';
echo strRevSort($str);
----- Output -----
wroolllhed
댓글목록
등록된 댓글이 없습니다.