Re: Temperature Script

From: Jari (not_at_here.fi)
Date: 01/05/04


Date: Mon, 5 Jan 2004 14:06:56 +0200

I have this function which prints out 5 so it's
the first line with that date.. Can this be used
to get all of them?

======function======
function array_search_bit($search, $yDate)
{
   foreach ($yDate as $key => $value)
   {
   if (strpos($value, $search) !== FALSE)
   return $key;
   }
   return FALSE;
}

$searchkey = array_search("05.01.2004", $yDate);
print "<br>$searchkey";
======function======

"CountScubula" <me@scantek.hotmail.com> wrote in message
news:I%bKb.6512$Mx7.5205@newssvr29.news.prodigy.com...
> "Jari" <not@here.fi> wrote in message news:btbhk0$ald$1@news.cc.tut.fi...
> > Thanks CountScubula.
> >
> your welcome
>
> > Now i need it to make arrays from the fifth day records like this:
> > $todayDate = "05.01.2004";
> > $todayTime = array(07:38:58, 09:33:19);
> > $todayTemp = array(-4.06, -4.50);
> >
> >
> > Thanks,
> > Jari
> >
> > ========outdoor.php========
> > /* outdoor.txt
> > Date; Time; Temp °C
> > 21.11.2003; 18:21:39; -2.69
> > 24.12.2003; 23:10:45; 0.06
> > 01.01.2004; 00:00:29; -5.75
> > 01.01.2004; 00:43:37; -6.13
> > 03.01.2004; 22:13:38; -8.44
> > 05.01.2004; 07:38:58; -4.06
> > 05.01.2004; 09:33:19; -4.50
> > */
> >
>
> Ok, its a little hard to understand your question with only a simple data
> example, I can take this two ways
>
> you want to take first time for day, and time of next day? just two items?
> > $todayTime = array(07:38:58, 09:33:19);
> > $todayTemp = array(-4.06, -4.50);
>
> or is it like this:
> $todayTime = array of times for a given date?
> $todayTemp = array of temps for a given date?
>
> you see, the problem is, you know what you are trying to do, so your
> questions seem simple, to me, I have no idea what you want to do with the
> data, so I see something like $todayTemp = array(-4.06, -4.50); and I
thnink
> you only want 2 items in the array? or is it all items on that date?
>
> just a tip, when posting a question, it is great that you show code and
file
> data, but please, explain how/why you want the data.
>
> a better way to ask would be like this:
>
> I need two items in this array like this
> $todayTime = array(07:38:58, 09:33:19);
>
> or
> need list of all items for that date
> $todayTime = array(07:38:58, 09:33:19);
>
> please don't take this offensively, this is just becouse I do not clearly
> understand the question.
>
> --
> Mike Bradley
> http://www.gzentools.com -- free online php tools
>
>



Relevant Pages

  • Re: Temperature Script
    ... I'm just a newb;D ... If day 05.01.2004 is found from $todayDate array it makes these two arrays: ... > you want to take first time for day, ... > just a tip, when posting a question, it is great that you show code and ...
    (alt.php)
  • Re: Keeping score
    ... Sorry for misunderstanding the first time. ... you are adding one to numCorrect or numIncorrect no matter ... I have tried using the qAnswered array found on the site, ... Dim visitedAs Boolean ...
    (microsoft.public.powerpoint)
  • Re: ADSI script for IIS 5.0 can not run in IIS 6.0
    ... The only way to determine "why" is for someone to look at the source code. ... This posting is provided "AS IS" with no warranties, and confers no rights. ... Problem fixed by changing the array for ServerBindings from dynamic array to ...
    (microsoft.public.inetserver.iis)
  • Strange "Stack Overflow" message occurring with use of vector
    ... this is the first time I've posted to it, ... with a dynamic array). ... binary chains stored consecutively in the vector at each iteration), ... the code breaks with a "Stack Overflow" error message. ...
    (microsoft.public.vc.language)
  • Re: RAMD stats for May
    ... How exactly are demands that you stop posting political items on RAMD ... I got it right the first time. ... America is held to be a place where freedom ... A country where freedom of speech is respected ...
    (rec.arts.marching.drumcorps)