hy guys this night I'm quite tired
I need a little tip
ok var n could be from 0 to 12
var f must be set
f=1 if0n=4
f=2 if 5n=7
f=3 if 8n=12
f=4 if n12
due to my fatigue I coded four if-if else statement,
in other languages it is possible use conditional epression in switch case
like
On Tue, 2005-09-20 at 19:20, adriano ghezzi wrote:
hy guys this night I'm quite tired
I need a little tip
ok var n could be from 0 to 12
var f must be set
f=1 if0n=4
f=2 if 5n=7
f=3 if 8n=12
f=4 if n12
due to my fatigue I coded four if-if else statement,
in other
in other languages it is possible use conditional epression in switch
case
like
switch $n
case (0n=4):
but no in php
You could use the following statement:
?php
switch (true) {
case (0 $n = 4):
$f = 1;
break;
case (5 $n = 7):
$f = 2;
break;
case (8 $n = 12):
$f = 3;
break;
On Tue, 2005-09-20 at 19:47, Thorsten Suckow-Homberg wrote:
You could use the following statement:
?php
switch (true) {
case (0 $n = 4):
$f = 1;
break;
case (5 $n = 7):
$f = 2;
break;
case (8 $n = 12):
$f = 3;
break;
default:
$f = 4;
break;
}
I'm certain that is illegal.
I'm certain that is illegal.
Wanna bet? :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Robert Cummings wrote:
On Tue, 2005-09-20 at 19:47, Thorsten Suckow-Homberg wrote:
You could use the following statement:
?php
switch (true) {
case (0 $n = 4):
$f = 1;
break;
case (5 $n = 7):
$f = 2;
break;
case (8 $n = 12):
$f = 3;
break;
default:
$f = 4;
break;
}
I'm certain that is
On Tue, 2005-09-20 at 19:55, Thorsten Suckow-Homberg wrote:
I'm certain that is illegal.
Wanna bet? :)
$100... cuz I'm sure you didn't mean to compound those conditionals such
that PHP doesn't understand them ;)
snaffu:~ php foo.php
Content-type: text/html
X-Powered-By: PHP/4.4.0
br /
Robert Cummings wrote:
On Tue, 2005-09-20 at 19:55, Thorsten Suckow-Homberg wrote:
I'm certain that is illegal.
Wanna bet? :)
$100... cuz I'm sure you didn't mean to compound those conditionals such
that PHP doesn't understand them ;)
Fair enough, but I believe it was the use of the
$100... cuz I'm sure you didn't mean to compound those conditionals such
that PHP doesn't understand them ;)
nargh... yes you're right... send me your account information along with
your paypal login. I'll send you the money asap ;)
--
PHP General Mailing List (http://www.php.net/)
To
thx to all
-- final release good nigh!
$f=0;
if ( $ar[0]0 and $ar[0]=12)
$f=1;
elseif ( $ar[0]12 and $ar[0]=14)
$f=2;
elseif ( $ar[0]14 and $ar[0]=18)
$f=3;
10 matches
Mail list logo