Re: sorting troubles
| From: | Peter Hoskin | Date: | Sat, 22 Apr 2006 10:06:44 +0000 |
| Subject: | Re: sorting troubles | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234550@lists.php.net to get a copy of this message | ||
See explode, http://www.php.net/explode
$var = 'A20,B16,B17C14,C15,D13,D12';
$array = explode(',',$var);
foreach ($array as $key => $value) {
echo $value ."\n";
}
William Stokes wrote:
> Hello,
>
> Any idea how to sort this?
>
> I have a column in DB that contains this kind of data,
> A20,B16,B17C14,C15,D13,D12 etc.
>
> I would like to print this data to a page and sort it ascending by the
> letter an descending by the number. Can this be done? Like
>
> A20
> B17
> B16
> C15
> C14
> D13
> D12
>
> Thanks
> -Will
>
>