That or do it in mysql before you get the data back, its also pretty good at
sorting, you know ;)
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
FeIn wrote:
Also check http://www.php.net/manual/en/function.natsort.php On Tue, Mar 1,
2011 at 1:39 PM, David Robley wrote
Also check http://www.php.net/manual/en/function.natsort.php
On Tue, Mar 1, 2011 at 1:39 PM, David Robley wrote:
> Ron Piggott wrote:
>
> >
> > I need help to know how to sort the words / phrases in my array.
> >
> > Variable name: $words_used
> > print_r( $words_used ); Current output: Array (
Ron Piggott wrote:
>
> I need help to know how to sort the words / phrases in my array.
>
> Variable name: $words_used
> print_r( $words_used ); Current output: Array ( [187] => Sin [249] =>
> Punished [98] => Sanctuary [596] => Sing [362] => Anointing Oil ) Desired
> result: Alphabetical sort:
You want to use usort, which lets you specify a comparison function.
function cmpByLength($a, $b) {
return strlen($a) > strlen($b);
}
usort($arrayToSort, 'cmpByLength');
And change the '>' to '<' if the ordering is wrong.
Rolf Brusletto wrote:
Hey all -
I've been scouring the php.net site for
On Thu, 13 Sep 2001 11:10:03 +0200 impersonator of
[EMAIL PROTECTED] (_lallous) planted &I saw in php.general:
>here's your script,
>
..
>Kill 'em All
>The Wall";
>
>$mem = split("\n", $mem);
Explode() is less expensive then split(), as long as you don't use regexp,
which is the case here, and (
another case-insensitive version:
"Dotan Cohen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to sort a listing of albums alphabetically
> for LyricsList.com, the problem is that I want the
> initial 'The' and 'A' in some albums (A Hard Days
>
here's your script,
"Dotan Cohen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm trying to sort a listing of albums alphabetically
> for LyricsList.com, the problem is that I want the
> initial 'The' and 'A' in some albums (A Hard Days
> Night, The Wall
7 matches
Mail list logo