try2 = $b['country'];
>>
>> if($country1=='') return 1;
>> else return ($country1 < $country2) ? -1 : 1;
>>
>>}
>>
>> -----Original Message-
>> From: weetat [mailto:[EMAIL PROTECTED]
>> Sent: Monday, J
weetat wrote:
> Hi all ,
>
> I have array value as shown below, i have paste my test php code below:
> I have problem when doing usort() when 'country' = '', i would like to
> display records where country = '' last. Any ideas how to do that ?
> ...
You might try searching the list's archive's.
Sent: Monday, July 31, 2006 1:57 PM
To: php-general@lists.php.net
Subject: Re: [PHP] sorting in array
At 10:31 PM 7/30/2006, weetat wrote:
> I have problem when doing usort() when 'country' = '', i would
> like to display records where countr
; Paul Novitski
Cc: php-general@lists.php.net
Subject: Re: [PHP] sorting in array
Thanks Paul,
Very weird tried Peter's option, it doesn't work.
Btw , how to sort by ascending ?
Thanks
Paul Novitski wrote:
> At 12:22 AM 7/31/2006, Paul Novitski wrote:
>> I could make th
At 01:14 AM 7/31/2006, weetat wrote:
Thanks Paul,
Very weird tried Peter's option, it doesn't work.
Btw , how to sort by ascending ?
Please explain what you mean. The current script DOES sort ascending
by country (except for the blank country fields which are placed at the end):
http:
Thanks Paul,
Very weird tried Peter's option, it doesn't work.
Btw , how to sort by ascending ?
Thanks
Paul Novitski wrote:
At 12:22 AM 7/31/2006, Paul Novitski wrote:
I could make that last statement just a bit simpler:
function cmpcountry($a, $b)
{
$country1 = ($a['country
At 12:22 AM 7/31/2006, Paul Novitski wrote:
I could make that last statement just a bit simpler:
function cmpcountry($a, $b)
{
$country1 = ($a['country'] == '') ? "zzz" : $a['country'];
$country2 = ($b['country'] == '') ? "zzz" : $b['country'];
return ($count
At 05:40 PM 7/30/2006, Peter Lauri wrote:
function cmpcountry($a, $b)
{
$country1 = $a['country'];
$country2 = $b['country'];
if($country1=='') return 1;
else return ($country1 < $country2) ? -1 : 1;
}
Good call, Peter; my suggestion was unne
At 10:31 PM 7/30/2006, weetat wrote:
I have problem when doing usort() when 'country' = '', i would
like to display records where country = '' last. Any ideas how to do that ?
...
$arraytest= array(
array
(
'country' => '',
)
,
array
(
untry2) ? -1 : 1;
}
-Original Message-
From: weetat [mailto:[EMAIL PROTECTED]
Sent: Monday, July 31, 2006 12:32 PM
To: php-general@lists.php.net
Subject: [PHP] sorting in array
Hi all ,
I have array value as shown below, i have paste my test php code below:
I have problem when doin
IL PROTECTED]
Sent: Monday, July 31, 2006 12:32 PM
To: php-general@lists.php.net
Subject: [PHP] sorting in array
Hi all ,
I have array value as shown below, i have paste my test php code below:
I have problem when doing usort() when 'country' = '', i would like to
display
Hi all ,
I have array value as shown below, i have paste my test php code below:
I have problem when doing usort() when 'country' = '', i would like to
display records where country = '' last. Any ideas how to do that ?
Thanks
$arraytest= array(
array
(
'country'
12 matches
Mail list logo