[TriLUG] Perplexed
Robert Ryals
rryals at tmio.com
Tue Apr 4 11:33:09 EDT 2006
Matt Frye wrote:
> Can someone tell me why the following code would not set $startdated
> to the correct date? Stuff inside the 'switch' seems to go into a
> black hole, even when it evals correctly.
>
> <?php
>
> $day = `date +%A`;
>
> print "<br>Day is $day - Before<br>";
>
>
Replace the above print statement with print "<br>Day is [$day]"; and
you will see why. There is a newline at the end of the $day variable.
Why are you executing an OS command to do something built into php ?
date("l") will get you the same thing.
Robert
More information about the TriLUG
mailing list