Bastien Koert
On 2012-04-11, at 2:18 PM, Floyd Resler wrote:
>
> On Apr 11, 2012, at 1:11 PM, admin wrote:
>
>>
>>
>> -Original Message-
>> From: Floyd Resler [mailto:fres...@adex-intl.com]
>> Sent: Wednesday, April 11, 2012 11:26 AM
&g
On 11 Apr 2012, at 16:26, Floyd Resler wrote:
> I need to sort the following array:
> {
> [Smith, Bob]=>array(137.5,125.5),
> [Jones, Robert]=>array(132.7,128.2)
> }
>
> The array needs to be sorted by the first number (i.e. 137.5) and then the
> second in descending order. I looked
On Apr 11, 2012, at 1:11 PM, admin wrote:
>
>
> -Original Message-
> From: Floyd Resler [mailto:fres...@adex-intl.com]
> Sent: Wednesday, April 11, 2012 11:26 AM
> To: PHP
> Subject: [PHP] Sorting Help
>
> I need to sort the following array:
>
-Original Message-
From: Floyd Resler [mailto:fres...@adex-intl.com]
Sent: Wednesday, April 11, 2012 11:26 AM
To: PHP
Subject: [PHP] Sorting Help
I need to sort the following array:
{
[Smith, Bob]=>array(137.5,125.5),
[Jones, Robert]=>array(132.7,128.2)
}
The
-Original Message-
From: Floyd Resler [mailto:fres...@adex-intl.com]
Sent: Wednesday, April 11, 2012 11:26 AM
To: PHP
Subject: [PHP] Sorting Help
I need to sort the following array:
{
[Smith, Bob]=>array(137.5,125.5),
[Jones, Robert]=>array(132.7,128.2)
}
The array
I need to sort the following array:
{
[Smith, Bob]=>array(137.5,125.5),
[Jones, Robert]=>array(132.7,128.2)
}
The array needs to be sorted by the first number (i.e. 137.5) and then the
second in descending order. I looked at array_multisort but couldn't figure
out how to make wo
On 2/28/2011 7:52 PM, 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 resul
On 1/03/2011, at 4:52 PM, 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
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: Array ( [362] => Anointing Oil [2
Eddie Drapkin wrote:
> http://us3.php.net/uasort
Exactly what I was looking for. Thanks.
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Sun, Sep 6, 2009 at 6:45 PM, James Colannino wrote:
> Hey everyone. I have an array that looks like this:
>
> $main_array[0] = array('key1' => 'vala');
> $main_array[1] = array('key1' => 'valb');
> etc.
>
> I want to sort the main array based on the value of key1 for each
> sub-array. I looked
Hey everyone. I have an array that looks like this:
$main_array[0] = array('key1' => 'vala');
$main_array[1] = array('key1' => 'valb');
etc.
I want to sort the main array based on the value of key1 for each
sub-array. I looked at all the array sorting functions, but unless I
misunderstood somet
In case anyone else was wondering, the command to use is COALESCE()
as in:
$theQuery = mysql_query("select variousFields from theTable where
date = '$currDate' ORDER BY COALESCE(rotime2,rotime1,time)");
COALESCE() will use "one" of the variables, being the one it finds a
value for first,
Hi all. Am trying to sort baseball games by time, where there can be
up to 3 times listed per game.
Each game has an original "date" and "time" field, plus fields for 2
rain-out dates/times ("rodate1" "rotime1", "rodate2", "rotime2"), to
use if the game gets rained out. Note that rotime1 an
Just a draft i thought should not go unnoticed on the list :-) just cleaning
up.
OK,
How about a super efficient soln where each string is only converted once
and a fast sorting algorithm is used:
http://www.ihostnz.com
Fred Allen - "California is a fine place to live - if you happen to be an
or
tedd wrote:
> At 9:31 PM -0600 2/14/09, Shawn McKenzie wrote:
>>
>> Yeah, hif I had known that you wanted a function where you loop through
>> your array twice, that would have done it. Bravo.
>
> Shawn:
>
> I don't see another way. You go through the array converting string to
> time (seconds),
At 9:31 PM -0600 2/14/09, Shawn McKenzie wrote:
Yeah, hif I had known that you wanted a function where you loop through
your array twice, that would have done it. Bravo.
Shawn:
I don't see another way. You go through the array converting string
to time (seconds), sort, and then convert back
tedd wrote:
> At 4:15 PM -0500 2/14/09, John Corry wrote:
>> 1. convert the string representation of times to timestamps using
>> strtotime()
>> 2. sort the timestamps
>> 3. display the timestamps as strings using date('format', timestamp)
>>
>> Would that work?
>>
>> John Corry
>> email: jco...@gm
At 4:15 PM -0500 2/14/09, John Corry wrote:
1. convert the string representation of times to timestamps using strtotime()
2. sort the timestamps
3. display the timestamps as strings using date('format', timestamp)
Would that work?
John Corry
email: jco...@gmail.com
John:
Bingo -- that worke
John Corry wrote:
> 1. convert the string representation of times to timestamps using
> strtotime()
> 2. sort the timestamps
> 3. display the timestamps as strings using date('format', timestamp)
>
> Would that work?
>
> John Corry
> email: jco...@gmail.com
>
>
>
>
> On Feb 14, 2009, at 4:07
1. convert the string representation of times to timestamps using
strtotime()
2. sort the timestamps
3. display the timestamps as strings using date('format', timestamp)
Would that work?
John Corry
email: jco...@gmail.com
On Feb 14, 2009, at 4:07 PM, tedd wrote:
Hi gang:
Anyone have/kno
Hi gang:
Anyone have/know a routine that will sort an array of times?
For example, a function that would take an array like this:
time[0] ~ '1:30pm'
time[1] ~ '7:30am'
time[2] ~ '12:30pm'
and order it to:
time[0] ~ '7:30am'
time[1] ~ '12:30pm'
time[2] ~ '1:30pm'
Cheers,
tedd
--
---
h
Tom Shaw wrote:
I'm having a problem sorting my array and wondered if anybody had experience
sorting arrays by their values. What I need to do is resort the array below
where the most expensive product shipping price starts at position zero no
matter how big the array is.
array(2) {
[0
Robert Cummings wrote:
> On Fri, 2008-08-22 at 21:04 +0100, Ashley Sheridan wrote:
>
>> Yeah, a bubble sorting algorithm should fix it, as it essentially only
>> a very simple sort required.
>>
>
> Why use bubble sort when you can use usort() function with an arbitrary
> handler?
>
> Chee
ysheridan.co.uk
> email message attachment, "Forwarded message - Re: [PHP] Sorting
> Arrays"
> > Forwarded Message
> > From: Micah Gersten <[EMAIL PROTECTED]>
> > To: Tom Shaw <[EMAIL PROTECTED]>
> > Cc: php-general@lists.php.net
>
Yeah, a bubble sorting algorithm should fix it, as it essentially only a
very simple sort required.
Ash
www.ashleysheridan.co.uk
--- Begin Message ---
I believe you'll need a custom sorting function for this.
http://us.php.net/usort
Thank you,
Micah Gersten
onShore Networks
Internal Developer
htt
I believe you'll need a custom sorting function for this.
http://us.php.net/usort
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
Tom Shaw wrote:
> I'm having a problem sorting my array and wondered if anybody had experience
> sorting arrays by their values.
I'm having a problem sorting my array and wondered if anybody had experience
sorting arrays by their values. What I need to do is resort the array below
where the most expensive product shipping price starts at position zero no
matter how big the array is.
array(2) {
[0] => array(48) {
Steve Marquez wrote:
I know this code does not work, but I was curious if someone can take a look
and tell me what is wrong? Thank you so much.
Re-indent your code properly. If you do it will look like:
";
while (($file = readdir($dh)) !== false) {
if (ereg($pattern, $file)
Steve Marquez wrote:
Greetings,
I have some code that opens a directory and displays the files. I want to
display the files in Alphabetical order.
I know this code does not work, but I was curious if someone can take a look
and tell me what is wrong? Thank you so much.
[ I hope the indenting
Greetings,
I have some code that opens a directory and displays the files. I want to
display the files in Alphabetical order.
I know this code does not work, but I was curious if someone can take a look
and tell me what is wrong? Thank you so much.
";
//echo "$file";
// iterate ove
Yep, that would be the perfect solution, but, unfortunately, database
is not an option for this project. Thanks for looking! I did get a
solution though from another list.
Here is a working version:
http://veanndesign.com/sorting.php
compare it to the not working one:
http://veanndesign.com/tes
On Thu, May 10, 2007 1:00 pm, James Tu wrote:
> (I've cross posted at the MySQL list as well)
>
> Here's an example with a simple table:
>
> describe collection;
>
> +--+-+--+-
> +-++
> | Field| Type
If you are going to sort it by various fields, I'd just throw it into
a database...
That said, http://php.net/usort should be able to do whatever you want.
On Thu, May 10, 2007 2:18 pm, Anna Vester wrote:
> Hello all,
>
> I have a question concerning .CSV array sorting. I have tried googling
> fo
A somewhat more extensible version of the 1 query method:
http://www.garfieldtech.com/blog/php-group-by
If you will only ever have 2 values there, then either method is probably
fine. The "php group by" method (above) is more extensible if you're going
to have a variable or arbitrary number of
When you load your data into your array, you can use the timezone (or whatever
field you're using to sort) as the array key, then use ksort().
Check the "see also" for a bunch of other types of sorting you can do.
When it comes to the multisorts and user defined sorts, I'm at a bit of a
loss..h
On 5/10/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
One place to start reading, Anna, would be the PHP manual for the
fgetcsv() function, which is specifically for CSV parsing.
http://www.php.net/fgetcsv
Thanks for your quick reply Daniel. Yes I've seen that function before
and i am u
One place to start reading, Anna, would be the PHP manual for the
fgetcsv() function, which is specifically for CSV parsing.
http://www.php.net/fgetcsv
On 5/10/07, Anna Vester <[EMAIL PROTECTED]> wrote:
Hello all,
I have a question concerning .CSV array sorting. I have tried googling
fo
Hello all,
I have a question concerning .CSV array sorting. I have tried googling
for an answer and have tried different techniques, but nothing seems
to works as I would like it to work. Here is my situation:
Test file is located here: http://veanndesign.com/test.php
I would like to be able to
On Thu, 2007-05-10 at 14:00 -0400, James Tu wrote:
> (I've cross posted at the MySQL list as well)
>
> Here's an example with a simple table:
>
> describe collection;
>
> +--+-+--+-
> +-++
> | Field| Typ
James Tu wrote:
> (I've cross posted at the MySQL list as well)
>
> Here's an example with a simple table:
>
> describe collection;
>
> +--+-+--+-
> +-++
>> Field| Type| Null | Key |
> Def
(I've cross posted at the MySQL list as well)
Here's an example with a simple table:
describe collection;
+--+-+--+-
+-++
| Field| Type| Null | Key |
Default | Extra
Search the archives for "multisort array" and you should find this
thread a few thousand times...
On Tue, April 24, 2007 6:58 pm, Jon Bennett wrote:
> hi,
>
> I have the following array, which I need to sort by quantity...
>
> Array
> (
> [2408] => Array
> (
> [name] => Hav
Jon Bennett wrote:
hi,
I have the following array, which I need to sort by quantity...
Array
(
[2408] => Array
(
[name] => Havaianas Top Pink Crystal
[size] => 5 (37/38)
[quantity] => 4
)
[3388] => Array
(
[name] => Havaian
array_multisort accepts column arrays but here you try to sort row based
arrays.
try this:
$b[self::$sortMember];
}
}
ArrayUtility::sortByMember($array, 'quantity');
?>
Am 25.04.2007, 12:36 Uhr, schrieb Frank Arensmeier
<[EMAIL PROTECTED]>:
Jon, I would suggest that you should have
this won't work if he has the same quantity for several keys, I think
Yes, you are correct. If that is the case, then you would just need to
change the following line
$tmpArray[$elArray['quantity']] = $elKey;
to
$tmpArray[$elArray['quantity']][] = $elKey;
then change logic in this loop:
2007. 04. 25, szerda keltezéssel 11.39-kor Chris Boget ezt írta:
> > I have the following array, which I need to sort by quantity...
> > I need to keep the indexes if poss.
>
> This may not be the most elegant solution. Let's call your array
> $origArray
>
> $tmpArray = array();
> foreach( $orig
> I have the following array, which I need to sort by quantity...
> I need to keep the indexes if poss.
This may not be the most elegant solution. Let's call your array
$origArray
$tmpArray = array();
foreach( $origArray as $elKey => $elArray ) {
$tmpArray[$elArray['quantity']] = $elKey;
}
i
Jon, I would suggest that you should have a look at the function
"array_multisort". See the manual for details on what this function
is capable of.
//frank
25 apr 2007 kl. 01.58 skrev Jon Bennett:
hi,
I have the following array, which I need to sort by quantity...
Array
(
[2408] => Arr
hi,
I have the following array, which I need to sort by quantity...
Array
(
[2408] => Array
(
[name] => Havaianas Top Pink Crystal
[size] => 5 (37/38)
[quantity] => 4
)
[3388] => Array
(
[name] => Havaianas Brazil Silver
Paul's probably right.. putting the sorting values in a table would be eaiser
to maintain. I don't know what I was thinking with the whole "then you don't
HAVE to create a table". Both ways work.. but especially if you think the
positions may change, then it'll be tons easier to update if th
How about this:
http://uk.php.net/manual/en/function.array-multisort.php#53779
Edward
> -Original Message-
> From: Dave Goodchild [mailto:[EMAIL PROTECTED]
> Sent: 08 February 2007 14:30
> To: Roman Neuhauser
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Sorting
array_multisort?
http://php.net/manual/en/function.array-multisort.php
hope that helps
Zoltán Németh
On cs, 2007-02-08 at 14:08 +, Dave Goodchild wrote:
> Hi all. I am building an online events directory and as part of the system
> users can search for events by date, category etc.
>
> The
Thanks for that - can't do that as all I know in the database is the start
and end date for each event (so I don't have to create mapping tables and
perform massive joins), the rest is handle dynamically.
I think I can do it using usort, this seems to work, any comments?
function compare($x, $y)
# [EMAIL PROTECTED] / 2007-02-08 14:08:13 +:
> Hi all. I am building an online events directory and as part of the system
> users can search for events by date, category etc.
>
> The logic involved in finding events that match the user-entered dates works
> like so:
>
> 1. we create a range o
Hi all. I am building an online events directory and as part of the system
users can search for events by date, category etc.
The logic involved in finding events that match the user-entered dates works
like so:
1. we create a range of dates from the start and end dates specified by the
user
2.
= = = Original message = = =
I need to sort the results of a DB query based on the hierarchy of positions
within an organization. Since they are not necessarily alphabetical, the
best I can come up with is to assign a numerical value in a separate table
to each position, and reference that to so
Well, kind of ugly but you can do something like this:
SELECT Position, CASE Position WHEN 'CEO' THEN 1 WHEN 'COO' THEN 2 WHEN 'CFO'
THEN 3 WHEN 'HR' THEN 4 ELSE 99 END AS PositionSort
FROM SomeTable
ORDER BY PositionSort
That way you're not creating a whole new table to store the sorting value
I have been trying to figure out how to get this to work for a couple of
days.
I need to sort the results of a DB query based on the hierarchy of positions
within an organization. Since they are not necessarily alphabetical, the
best I can come up with is to assign a numerical value in a separa
Result. Cheers!
On 11/16/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
On Thu, 2006-11-16 at 15:28 +, Dave Goodchild wrote:
> Hi all. I have a multidimensional array here:
>
> Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "The
Pleasure
>
> [--SNIP--]
>
> ...which comprises a
On Thu, 2006-11-16 at 15:28 +, Dave Goodchild wrote:
> Hi all. I have a multidimensional array here:
>
> Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "The Pleasure
>
> [--SNIP--]
>
> ...which comprises a set of returned results for an events search - with the
> date computed dy
Hi all. I have a multidimensional array here:
array(6) { [0]=> array(25) { [0]=> string(1) "7" ["eventid"]=> string(1) "7"
[1]=> string(2) "17" ["cat_id"]=> string(2) "17" [2]=> string(13) "Tits And
Bums" ["name"]=> string(13) "Tits And Bums" [3]=> string(19) "The Pleasure
Centre" ["venue"]=> str
On 07/11/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
you really need to deal with this issue at the database design/data
entry level. doing things on the sort to exclude (otherwise undefined)
initial articles (as some have suggested) is very maintenance heavy as
you have to update the sort p
On Monday 06 November 2006 08:15, clive wrote:
> > Current code:
> > $query = "SELECT subject FROM table ORDER BY subject asc";
> > $result = mysql_query($query);
>
> I dont seen any php code to do any sorting,just a mysql query, perhaps a
> mysql list or maybe you should try doing it in php yours
On 06/11/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Sun, November 5, 2006 7:13 am, Dotan Cohen wrote:
> I have a list of subjects, such as "Linux", "Open Source", and "the
> World Wide Web". The subjects are stored in a database and being
> retrieved via php. I currently organize them alphab
On Sun, November 5, 2006 7:13 am, Dotan Cohen wrote:
> I have a list of subjects, such as "Linux", "Open Source", and "the
> World Wide Web". The subjects are stored in a database and being
> retrieved via php. I currently organize them alphabetically with SQL's
> ORDER BY ASC argument, however, if
On 11/5/06, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
If you used PostgreSQL I'd suggest a functional index and ordering
on the function... Does MySQL have anything like this?
CREATE FUNCTION fn(TEXT)
RETURNS TEXT
IMMUTABLE STRICT
LANGUAGE SQL
AS $$
SELECT reg
At 3:13 PM +0200 11/5/06, Dotan Cohen wrote:
I have a list of subjects, such as "Linux", "Open Source", and "the
World Wide Web". The subjects are stored in a database and being
retrieved via php. I currently organize them alphabetically with SQL's
ORDER BY ASC argument, however, if there is a pr
Current code:
$query = "SELECT subject FROM table ORDER BY subject asc";
$result = mysql_query($query);
I dont seen any php code to do any sorting,just a mysql query, perhaps a
mysql list or maybe you should try doing it in php yourself first.
Not that I know the answer, but mysql does have
# [EMAIL PROTECTED] / 2006-11-05 15:13:19 +0200:
> I have a list of subjects, such as "Linux", "Open Source", and "the
> World Wide Web". The subjects are stored in a database and being
> retrieved via php. I currently organize them alphabetically with SQL's
> ORDER BY ASC argument, however, if the
I have a list of subjects, such as "Linux", "Open Source", and "the
World Wide Web". The subjects are stored in a database and being
retrieved via php. I currently organize them alphabetically with SQL's
ORDER BY ASC argument, however, if there is a preceding "the " or "a "
then that is considered
Hi,
RE: Sorting Multidimensional Array
I'm trying to sort a multidimensional array. The data was taken from
a mysql query:
$myrow = mysql_fetch_row($result) {
query[] = $myrow;
}
The purpose is to retrieve the table data and manually add a record,
then sort ASC by the startdate which is the
>
To: "Keith Spiller" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, October 31, 2006 10:48 AM
Subject: Re: [PHP] Sorting Multidimensional Array
On Tue, October 31, 2006 11:10 am, Keith Spiller wrote:
RE: Sorting Multidimensional Array
I'm trying to sort a multidimensional array.
On Tue, October 31, 2006 11:10 am, Keith Spiller wrote:
> RE: Sorting Multidimensional Array
>
> I'm trying to sort a multidimensional array. The data was taken from
> a mysql query:
>
> $myrow = mysql_fetch_row($result) {
> query[] = $myrow;
> }
>
> The purpose is to retrieve the table data an
On Tue, August 15, 2006 9:01 am, [EMAIL PROTECTED] wrote:
> I have an array of products $products
> $products = array_count_values($products);
> now I have an array where $key is product number and $value is how
> many
> times I have such a product in the array.
> I want to sort this new array that
hi to all!
I have an array of products $products
$products = array_count_values($products);
now I have an array where $key is product number and $value is how many
times I have such a product in the array.
I want to sort this new array that product with the most "duplicates" are
on the first place
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'
hi guys,
thanks for the replies! yes Melanie, you were correct the last example
(i had an old version of the manual). seemed to do the trick =)
Thanks to john as well for the reply.
Angelo
Melanie Maddix wrote:
[snip]
So they way I want to sort these rows is by total, totalPaid,
totalUnpa
On 7/26/06, Angelo Zanetti <[EMAIL PROTECTED]> wrote:
Hi all,
So they way I want to sort these rows is by total, totalPaid,
totalUnpaid all descending.
Hi Angelo,
So the first question the list will ask is if the array of data is
coming from a database. Because then you'd be urged to perform
Hi all,
Need some advice as to how to sort a array:
Structure:
partnerID
partnerName
total
totalPaid
totalUnpaid
So basically there will be many entries for the following:
eg:
partnerID | partnerName | total | totalPaid | totalUnpaid
1 marc 12 5
Thanks for your input everyone!
The easiest way to do this was ansding this to the SELECT clause:
select col from DB order by substring(col, 1, 1) ASC, substring(col, 2) DESC
Seems to work fine.
-Will
""Richard Lynch"" <[EMAIL PROTECTED]> kirjoitti
viestissä:[EMAIL PROTECTED]
> On Sat, April 2
On Sat, April 22, 2006 4:49 am, William Stokes wrote:
> 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
> B1
On Apr 24, 2006, at 9:06 AM, Philip Thompson wrote:
On Apr 22, 2006, at 4:49 AM, 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
On Apr 22, 2006, at 4:49 AM, 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 do
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?
PHP ha
> 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
Depending on how many recor
At 03:43 AM 4/22/2006, I wrote:
Then just do a reverse sort on $aTemp and you get:
Z20
Y17
Y16
Then translate the letters back to their original values and you get:
A20
B17
C16
Oops, I made a typo: that final value should have been B16, not C1
At 02:49 AM 4/22/2006, William Stokes wrote:
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
Wi
hmm, should also see http://www.php.net/sort
Peter Hoskin wrote:
> 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
1 - 100 of 395 matches
Mail list logo