Welcome to FindNerd. Today we are going to discuss the function natsort. There are many sorting function available for different types of sorting like usort,asort etc.
natsort uses natural order algorithm. It is nothing but to sequence element according to natural manner. It will retutn the true or false in response. Please
have a look.
<?php
$record_arr = array('rec03','rec002','rec23','rec0334');
natsort($record_arr);
print_r($record_arr);
?>
result: Array ( [1] => rec002 [0] => rec03 [3] => rec0334 [2] => rec23 )
In above example we pass an array of records and sort it by using natsort.
0 Comment(s)