Paul Nicholson wrote:
>If ($days > 30) {
>$days = "" . $days . "";
>}elseif ($days > 45) {
>$days = "" . $days . "";
>}
>
Just a side note - the elseif when used like this is superfluous.
If $days is not greater than 30, then it must be 30 or less. Thus, it
will never be greater than 4
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
oppsI need those reversed.
-
switch (TRUE) {
case ($days > 45):
$days = "" . $days . "";
break;
case ($days > 30):
$days = "" . $days . "";
break;
}
-
If ($days > 45) {
$days = "" . $days . "";
}
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
yeah, I know...duh! *yawn* long nite...I'll see y'all in the morn. :)
~Paul
On Tuesday 01 October 2002 11:22 pm, Chris Shiflett wrote:
> Paul Nicholson wrote:
> >If ($days > 30) {
> >$days = "" . $days . "";
> >}elseif ($days > 45) {
> >$days
Anyway... cool way to use switch
Obviously i've been working too much with C, that i never thought of a way,
you could use the conditional-expression in the "case", not in the switch ;)
Sascha
> switch (TRUE) {
> case ($days > 45):
> $days = "" . $days .
> ""; break; case
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hey,
ok, I'm not sure if I totally understand what you're trying to do but.I'll give
it my best. Try:
switch (TRUE) {
case ($days > 30):
$days = "" . $days . "";
break;
case ($days > 45):
$days = ""
A, ok. You know am still having problems with elseif, else, Ok, thanks I
will give it a try.
Chuck
On 10/1/02 11:03 PM, "Chris Shiflett" <[EMAIL PROTECTED]> wrote:
> Chuck,
>
> I'm not sure what you're trying to do, but I think you might just want
> to order it the other way around.
>
>
and just when I thought this day couldnt get any more confusing:|
-Original Message-
From: Chuck "PUP" Payne [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 2 October 2002 12:50 PM
To: PHP General
Subject: [PHP] Wanting to better understand
Hey,
I am trying to better understand s
Chuck,
I'm not sure what you're trying to do, but I think you might just want
to order it the other way around.
if ($days > "45")
{
# $days is 46 or more
do stuff
}
elseif ($days > "30")
{
# $days is 31-45
do other stuff;
}
else
{
# $days is 30 or less
more stuff;
8 matches
Mail list logo