문제

I have a array like below. I am trying to sort the array alphabetically with asort. but it does not work

Array
(
    [0] => BelExpo exhibition center
    [1] => Aurora cinema theatre
    [2] => Yunost Ice hockey palace
    [3] => Rakauski free market
    [4] => Grushevka Metro Station

)

$arr = asort($arr1); // output gives 1

thanks in advance

도움이 되었습니까?

해결책

OK great I solved the problem.

sort return boolean value. no need to put it in variable. just pass the array in sort. and it will work

sort($arr);

print_r($arr);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top