and I need sorting array by minimum, maximum and alphabet. You can see at my example how i showing data without sorting.[$id]|$id|$data1|$data2|[$id]
Country.txt
[1][]|1|USA|15|[1][2][]|2|Mexico|12|[2][3][]|3|Austria|11|[3][4][]|4|France|8|[4][5][]|5|Singapore|4|[5]
Code: Select all
<?php
$dat = substr(file_get_contents("country.php"),0,100000000000);
$datsum = substr_count($dat, '[]');
for ($i=$datsum;$i>=1;$i--)
{
$stra = explode("[]", $dat);
$a = explode('|', $stra[$i]);
echo "$a[2] $a[3]<br>";
}
?>I need sorting by alphabet. The above example that i need output:
Singapore 4
France 8
Austria 11
Mexico 12
USA 15
I need sorting by max, min. The above example that i need output:Austria 11
France 8
Mexico 12
Singapore 4
USA 15
Thanks for answers.Singapore 4
France 8
Austria 11
Mexico 12
USA 15