Re: strings
| From: | Thomas Holton | Date: | Fri, 01 Dec 2000 02:07:47 +0000 |
| Subject: | Re: strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28146@lists.php.net to get a copy of this message | ||
Well, thanks for the responses. I went back and checked it, and when i
change the var name to $ds[$i] instead of $d[$i], it also worked as it
should. Strange, i have no idea why this had this problem, and wondered of
the var "$d" had some strange connection to it, but clearly it does not
according to your results.
thanks for the input.
On Thu, 30 Nov 2000, Philip Hallstrom wrote:
> I just did the following (don't have get_next_month) and it works like
> it should. This is on 4.0.2
>
> <?php
> $day[$i] = "2000-11-30";
> $day[$i] .= "-";
> $item = explode("-", $day[$i]);
> $y[$i] = $item[0];
> $m[$i] = $item[1];
> $d[$i] = $item[2];
> print "Stored $i: m=$m[$i],d=$d[$i],y=$y[$i] == $day[$i]";
> ?>
>
> In article <Pine.OSF.4.30.0011301412170.899-100000@ewald.mbi.ucla.edu> you write:
> >
> >Hi, I am confused why the following does not work:
> >
> ><snip>
> > $day[$i] = mysql_result($r,$j,"day");
> > $day[$i] .= "-";
> > $item = explode("-", $day[$i]);
> > $y[$i] = $item[0];
> > $m[$i] = get_next_month($item[1]);
> > $d[$i] = $item[2];
> >print "Stored $i: m=$m[$i],d=$d[$i],y=$y[$i] == $day[$i]";
> ><snip>
> >
> >prints:
> >Stored 0: m=Nov,d=3,y=2000 == 2000-11-30-
> >
> >my question is: why does the $d[$i] var only get only number, 3, instead
> >of 30, when the $y[$i] var gets all four, or 2000?
> >
> >TIA
> >-tom
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-general-help@lists.php.net
> >To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>