Re: Re: sorting a list using regex
| From: | Miguel Cruz | Date: | Thu, 06 Jun 2002 01:28:13 +0000 |
| Subject: | Re: Re: sorting a list using regex | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100842@lists.php.net to get a copy of this message | ||
I completely don't understand what you're trying to say, but I have a
sneaking suspicion the usort() functions might be helpful here.
miguel
On Wed, 5 Jun 2002, Joshua E Minnie wrote:
> I am trying to sort a list by their first character, my problem comes when
> that first character is a number. When the character is a number I should
> be able to display just the values which begin with a number. When the
> value is a letter, I have no problem sorting this out. Here is the code
> that I am using to determine that, any help will be greatly appreciated.
>
> <?
> [snip]
> while(!feof($fp)) {
> $artist = fgetcsv($fp,1024,":");
> if(isset($_GET["sort"])) {
> if(($_GET["sort"] != substr(strtoupper($artist[0]),0,1)) &&
> !($_GET["sort"] == "#" && ereg("^[0-9]",$artist[0])))
> continue;
> }
> }
> [snip]
> ?>
>
> Running PHP 4.2.1 on IIS 5 W2K
>
> Thanks
>
> -josh
>
>
>
>
>
>