note 68288 deleted from function.sort by nlopess
| From: | nlopess@php.net | Date: | Fri, 21 Jul 2006 10:52:30 +0000 |
| Subject: | note 68288 deleted from function.sort by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-115003@lists.php.net to get a copy of this message | ||
Note Submitter: memzap at gmail dot com
----
I am having an issue trying to figure out how to sort an array. Here is the issue.
I am trying to put titles of a book into an array and sort by the first field of a flat database
which is the title. When I sort it sorts titles starting with "a" at the top of course,
and "the" at the end where it should be.
I would like to exlude certain words before the sort but have them back on the display of the Title.
I tried to write out code to do this but it seemed to explode into a huge program. I was wondering
if anyone has a simple way of doing this.
while ( ! feof( $fp ) ) {
$m14line[] = fgets( $fp, 1024 );
sort($m14line);
list($m14title1, $m14titleurl1, $m14rating1) = split ('\|', $line[0]);
list($m14title1, $m14titleurl1, $m14rating1) = split ('\|', $line[1]);
list($m14title1, $m14titleurl1, $m14rating1) = split ('\|', $line[2]);
list($m14title1, $m14titleurl1, $m14rating1) = split ('\|', $line[3]);
}
?>
This is a sample of the display code I currently have. This doesn't do anything special other
than pull the array in and sort by the first word of the Title. I am looking to skip any words that
I choose to skip, like for instance the word "the" in all cases.
Thanks for any help in advance.