sorting two arrays

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
this is prolly too simple but i got a brain block

i have two arrays, one is days[1-7] and the other is
timeofday[a-l],<each letter represents a time on the hour>
how do is sort by days and put each day's list in order of time?
so that i get a list in order of days and each day is in order of
time...i can put in order by day or time but they always end up with
whatever is the other order wrong.

  if ( isset($_GET['sort']) && $_GET['sort']=='call_days' ) {
$_SESSION['sort'] = 'call_days'; }

   if ( isset($_GET['sort']) && $_GET['sort']=='call_time' ) {
$_SESSION['sort'] = 'call_time'; }


<?php if ($_SESSION['sort']!='call_time') { echo '<a
href="',$_SERVER['PHP_SELF'],'?sort=call_time">Call Time</a>'; } else {
echo 'Call Time &darr;'; } ?>

<?php if ($_SESSION['sort']!='call_days') { echo '<a
href="',$_SERVER['PHP_SELF'],'?sort=call_days">Call Days</a>'; } else {
echo 'Call Days &darr;'; } ?>


Re: sorting two arrays

I noticed that Message-ID:
contained the following:

Quoted text here. Click to load it

Maybe I have brain block too but that code seems to have nothing to do
with the question.
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs /

Re: sorting two arrays

Geoff Berrow wrote:
Quoted text here. Click to load it

well now, what i am looking to do is explained as best as i can. what
does this code do? i am thinking i need to do for each day:
(day[1-7])(time[a-l])starting with day1-a getting a total of 72
interations ending with (day7-l)


Re: sorting two arrays

Terry Richards wrote:
Quoted text here. Click to load it

That makes it clear as a pint of Guiness...  Show us the code that (1)
loads the arrays and (2) sorts them.


convert uppercase WORDS to single keystrokes to reply

Site Timeline