How to sort a string in ascending order with PHP

1 Answer

0 votes
$s = "php c# c java python c++";

$arr = str_split($s);

sort($arr);

$s = implode($arr);

echo $s;
 
 
 
 
/*
run:
 
     #++aaccchhjnoppptvy
 
*/

 



answered Mar 27, 2021 by avibootz

Related questions

2 answers 219 views
1 answer 130 views
1 answer 171 views
1 answer 180 views
1 answer 191 views
1 answer 194 views
...