I have the following output values from a associative array (id => value):
1GB - 4GB
1TB - 2TB
3TB - 5TB
5GB - 16GB
6TB+
17GB - 32GB
33GB - 63GB
64GB - 120GB
121GB - 200GB
201GB - 300GB
301GB - 500GB
501GB - 1TB
How can I group and sort it so that I get it goes from smallest to largest:
so:
1GB - 4GB
5GB - 16GB
etc...
etc..
501GB - 1TB
1TB - 2TB
etc..
I have the following loop:
foreach($hdArray as $key => $value) {
echo '<label><input type="radio" class="checkbox" name="hd" value="'.$key.'" /> '.$value.'</label>';
}