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:
?php
function time_sort($a, $b) {
static $now = time();
if (strtotime($a, $now) ==
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
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), sort, and
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
--
---
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
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 PM, tedd
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
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...@gmail.com
John:
8 matches
Mail list logo