On Thu, May 4, 2006 10:20 am, James Nunnerley wrote:
> What I'm not sure about doing is sorting by say Size or Date?
There's several different examples of date sorts here:
http://www.weberdev.com/AdvancedSearch.php?searchtype=title&search=date+sort&Submit1.x=0&Submit1.y=0
HTH's
tedd
--
On Thu, May 4, 2006 10:47 am, Stut wrote:
> It's worth noting that if you're not using the fact that they're
> indexed
> on the filename it's probably faster to use integer keys instead of
> strings, but don't quote me on that. I'm not overly familiar with the
> internals of PHP... yet!
I think th
On Thu, May 4, 2006 10:20 am, James Nunnerley wrote:
> $file_array[$filename] = array ("Date" => $Date, "size" => $size,
> "permissions" => $permissions);
>
> I can quite happily sort the array by filename (using natksort and
> natkrsort), which I found on the php manual - and for reference have
>
James Nunnerley wrote:
I think I may have written down my variable structure incorrectly in the
first place, which even has me confused...
The $file_array[$filename] is I don't think a further array.
The "sub" values are created as follows:
$file_array[$filename]["Date"] = ...
$file_array[$fi
ke by not defining $file_array[$filename]? I don't
think so, but would be happy to be corrected!
Cheers
Nunners
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED]
Sent: 04 May 2006 16:24
To: James Nunnerley
Cc: php-general@lists.php.net
Subject: Re: [PHP] Array Sorting
James N
James Nunnerley wrote:
I've got an array which has the following properties:
$file_array[$filename] = array ("Date" => $Date, "size" => $size,
"permissions" => $permissions);
I can quite happily sort the array by filename (using natksort and
natkrsort), which I found on the php manual - and fo
Hi All,
I've got an array which has the following properties:
$file_array[$filename] = array ("Date" => $Date, "size" => $size,
"permissions" => $permissions);
I can quite happily sort the array by filename (using natksort and
natkrsort), which I found on the php manual - and for reference have
Hi there,
I would like to save some db power by putting values into a file which are often
used. They basicly populate a select field.
So I placed those values into associative arrays:
$code[language] = array("1"=> "php", "2"=> "asp");
Now I would like to sort those for displaying after my prefer
Greetings everyone :
Having a hard time with this one. I have a multi-dim array
$foo[$x][$y]['key'], where $x and $y are numeric. Here is some sample data :
Array
(
[$x] => Array
(
[0] => Array
(
[invoiceid] => 11842
[
ilto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 11:25 AM
> To: Dan Joseph
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Array Sorting, 2 items...
>
>
> Your array seems like a result of mysql_fetch_array(), cannot you order
> it in the sql query?
>
> Dan Joseph wrote:
ideas?
-Dan Joseph
> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 11:39 AM
> To: 'Dan Joseph'; [EMAIL PROTECTED]
> Subject: RE: [PHP] Array Sorting, 2 items...
>
>
> > -Original Message-
&g
* Thus wrote Dan Joseph ([EMAIL PROTECTED]):
> Eek... Yes, I did past it wrong...
>
> SELECT payment_methods.ba_type, loan_info.loan_number, loan_info.id AS
> loan_id, cust_info.first_name, cust_info.last_name,
> transactions.approved_date, payment_types.type FROM loan_info, cust_info,
> transact
nything wrong with that? Shouldn't that give me
the sort I'm looking for without having to do a usort?
-Dan Joseph
> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 11:39 AM
> To: 'Dan Joseph'; [EMAIL PROTECTE
> -Original Message-
> From: Dan Joseph [mailto:[EMAIL PROTECTED]
> Sent: 22 July 2003 16:29
>
> Yeah, I did get it from a mysql_fetch_array(). I have:
>
> ORDER BY
> payment_methods.ba_type ASC,
> loan_info.loan_number ASC
>
> H
;) GROUP BY loan_info.id
ORDER BY loan_info.loan_number ASC
Maybe I'm doing something wrong there?
-Dan Joseph
> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 22, 2003 11:25 AM
> To: Dan Joseph
> Cc: [EMAIL PROTECTED]
Your array seems like a result of mysql_fetch_array(), cannot you order
it in the sql query?
Dan Joseph wrote:
Array
(
[0] => Array
(
[0] => CHECKING
[ba_type] => CHECKING
[1] => 10132200
[loan_number] => 10132200
Keep e
Hi,
Trying to accomplish:
I want to sort my array by two columns. The array is setup:
Array
(
[0] => Array
(
[0] => CHECKING
[ba_type] => CHECKING
[1] => 10132200
[loan_number] => 10132200
[2
Marek Kilimajer wrote:
BTW, this is what I always receive when mailing you:
Diagnostic-Code: SMTP; 554 5.7.1 Original message rejected due to high
SPAM score: 97.4
Hrm, yes. Has to do with your .sk domain I'm sure. Bloody
automatic filters.
Thanks for the function, it works as expected
BTW, this is what I always receive when mailing you:
Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.7.1
Remote-MTA: DNS; serpico.pcraft.com
Diagnostic-Code: SMTP; 554 5.7.1 Original message rejected due to high
SPAM score: 97.4
Last-Attempt-Date: Thu, 19 Jun 2003 11:36:23 +02
Yes, simply don't return 0 when the manufacturers are equal, but
continue with other checks:
function cmp ($a, $b) {
if ($a['cat'] == $b['cat']) {
// return 0; -- not anymore, but go on to compare manuf.
if ($a['manufacturer'] == $b['manufacturer']) {
if ($a['titl
Marek Kilimajer wrote:
Use usort. This function should do the work:
Hey thanks! That worked like a charm, once I figured out that
making the comparison < instead of > I would get an ascending sort
instead of the descending one. Now, can I do multiple sorts? Like,
sort on "cat" first, "man
Use usort. This function should do the work:
function cmp ($a, $b) {
if ($a['manufacturer'] == $b['manufacturer']) return 0;
return ($a['manufacturer'] > $b['manufacturer']) ? -1 : 1;
}
Ashley M. Kirchner wrote:
I have an array that looks like this:
$i = 0;
$item[$i] = array( 'link'
I have an array that looks like this:
$i = 0;
$item[$i] = array( 'link' => 'http://...',
'image' => '/images/image.jpg',
'title' => 'some title',
'price' => '$14.00',
'cat'=> 'Frames',
'author' =>
My question is if anyone have any idé on how to sort this array so that the
names and ages are sorted after Close Friend, Friend, Wife and last
Family...
$A[] = array ("Nils", "23", "Friend");
$A[] = array ("Emma", "21", "Friend");
$A[] = array ("Cassie", "21", "Wife");
$A[] = array ("Zydox", "23"
I have looked through php.net and the books that I have and I am confused,
so I hope that someone can help me out here. I am trying to sort an array
that I have. I use a while statement to fill the array:
$teams[++$i][team_id]=$row->team_id;
$teams[$i][name]=$row1->name;
$teams[$i][team_sea_id
25 matches
Mail list logo