Re: [PHP] filter out with date?

2003-06-09 Thread A. Lyse
John W. Holmes [EMAIL PROTECTED] wrote
 Wouldn't it be smarter to only fill this array with items matching the
 date you want in the first place??
How?

 Anyhow...now you'll have to loop through each ingress Object and see
 if substr($obj-publisert,-2) matches the month you want.
Dont know if I understood that one :(

Regards,
A. Lyse



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] filter out with date?

2003-06-09 Thread John W. Holmes
  Wouldn't it be smarter to only fill this array with items matching
the
  date you want in the first place??
 How?

I don't know. You do create this array at some point, right? How do you
do it? How do you create the date field in the ingress Object ?
Whenever/However you're creating this list, look at the date field in
the object and only add it to your array if it matches the dates your
looking for.

  Anyhow...now you'll have to loop through each ingress Object and
see
  if substr($obj-publisert,-2) matches the month you want.
 Dont know if I understood that one :(

You have a variable called publisert in the ingress Object inside of
your array, right? The format is  DD/MM, it appears. Odd as that may
be, if you use substr() to just pull the last two characters, the month,
and then match that to the month your looking for, you'll see if this
object is one that you want to keep or not. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] filter out with date?

2003-06-08 Thread John W. Holmes
 I got the array info: on the articles:
 Array
 (
 [0] = ingress Object
 (
 [artikkelid] = 241
 [nettstedid] = 11
 [gyldig] = 1
 [overskrift] = motorsport formel1
 [artikkellink] = art.php?artikkelid=241
 [forfatternavn] = Aleksander Lyse
 [forfatterlink] = http://www.ikke.no/
 [ingress] = Formel1
 [publisertLang] = 20030530135301
 [publisert] = 2003 30/05
 [bilde] =
 [artikkeltypeid] = 38
 )
 
 The code I use to feed the articles are:
 
 if($ingresser =
 hentIngresser($nettstedid,37,$sprakid,$offsetannet,$antal1ingress))
 listIngresser1($ingresser);
 
 How can I only show the articles from eg. 2003 01/06 - 2003 31/6

Wouldn't it be smarter to only fill this array with items matching the
date you want in the first place??

Anyhow...now you'll have to loop through each ingress Object and see
if substr($obj-publisert,-2) matches the month you want. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php