Re: [PHP] Wanting to better understand
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; } Also, be careful about overwriting $days with that long string and then trying to compare it to a numeric value. You probably want to use a different variable name for the string. Happy hacking. Chris Chuck \PUP\ Payne wrote: If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Wanting to better understand
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 something, I learned a couple weeks ago that if I do this... If ($field == value1) { $field = change to new value; Now I have use this to change -00-00 to nbsp;. And the following. If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. I sorry that this might be confusing but I am trying to ask the way I can. I am not sure what you call this, expression I think. Any way is there a way that I can use this expression to get two or more colors. Thanks Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wanting to better understand
Hey, I am trying to better understand something, I learned a couple weeks ago that if I do this... If ($field == value1) { $field = change to new value; Now I have use this to change -00-00 to nbsp;. And the following. If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. I sorry that this might be confusing but I am trying to ask the way I can. I am not sure what you call this, expression I think. Any way is there a way that I can use this expression to get two or more colors. Thanks Chuck Payne Magi Design and Support -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
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. 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; } Also, be careful about overwriting $days with that long string and then trying to compare it to a numeric value. You probably want to use a different variable name for the string. Happy hacking. Chris Chuck \PUP\ Payne wrote: If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
-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 = strongfont color='ff' . $days . /font/strong; break; case ($days 45): $days = strongfont color='ff00ff' . $days . /font/strong; break; } or: If ($days 30) { $days = strongfont color='ff' . $days . /font/strong; }elseif ($days 45) { $days = strongfont color='ff00ff' . $days . /font/strong; } HTH! ~Pauly On Tuesday 01 October 2002 10:50 pm, Chuck \PUP\ Payne wrote: Hey, I am trying to better understand something, I learned a couple weeks ago that if I do this... If ($field == value1) { $field = change to new value; Now I have use this to change -00-00 to nbsp;. And the following. If ($days 30) { $days strongfont color='ff' . $days . /font/strong; } Want I want to do was add a second line this below to change the another value to change to change to another color... If ($days 45) { $days strongfont color='ff00ff' . $days . /font/strong; } But, the second value is over riding the first vaule so I can't see the differents. I sorry that this might be confusing but I am trying to ask the way I can. I am not sure what you call this, expression I think. Any way is there a way that I can use this expression to get two or more colors. Thanks Chuck Payne Magi Design and Support - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9mmNtDyXNIUN3+UQRAuPnAJ9rMhXkTfeLsxYy8MzO1BtxA1bUMgCfcmR4 MhMn3ihvEdecAxUcQt2S2U8= =C4fu -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
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 = strongfont color='ff00ff' . $days . /font/strong; break; case ($days 30): $days = strongfont color='ff' . $days . /font/strong; break; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
-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 = strongfont color='ff' . $days . /font/strong; }elseif ($days 45) { $days = strongfont color='ff00ff' . $days . /font/strong; } 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 45. - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9mmgNDyXNIUN3+UQRAhrdAJ0bXw015Qm8hVR6ZMZqq4YheOQoDwCeMwEC DiITc88LjDqHEKKLX05eyLQ= =2CnR -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 oppsI need those reversed. - switch (TRUE) { case ($days 45): $days = strongfont color='ff00ff' . $days . /font/strong; break; case ($days 30): $days = strongfont color='ff' . $days . /font/strong; break; } - If ($days 45) { $days = strongfont color='ff' . $days . /font/strong; }elseif ($days 30) { $days = strongfont color='ff00ff' . $days . /font/strong; } - ~Paul On Tuesday 01 October 2002 11:09 pm, Paul Nicholson wrote: 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 = strongfont color='ff' . $days . /font/strong; break; case ($days 45): $days = strongfont color='ff00ff' . $days . /font/strong; break; } or: If ($days 30) { $days = strongfont color='ff' . $days . /font/strong; }elseif ($days 45) { $days = strongfont color='ff00ff' . $days . /font/strong; } HTH! ~Pauly - -- ~Paul Nicholson Design Specialist @ WebPower Design The webthe way you want it! [EMAIL PROTECTED] It said uses Windows 98 or better, so I loaded Linux! Registered Linux User #183202 using Register Linux System # 81891 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9mmV5DyXNIUN3+UQRApoNAJ9CVpSw5QIHeBHS6uIOCaAXVnpQjgCdG1ye kVMaV+ecWgxC/CEVF2Zw4bs= =ncYb -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Wanting to better understand
Paul Nicholson wrote: If ($days 30) { $days = strongfont color='ff' . $days . /font/strong; }elseif ($days 45) { $days = strongfont color='ff00ff' . $days . /font/strong; } 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 45. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php