Re: 2 ifs embedded? (RESOLVED)
| From: | Colin Guthrie | Date: | Sat, 01 Aug 2009 18:57:27 +0000 |
| Subject: | Re: 2 ifs embedded? (RESOLVED) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296169@lists.php.net to get a copy of this message | ||
'Twas brillig, and Miller, Terion at 31/07/09 17:11 did gyre and gimble:
If (ctype_digit($row['critical'])){ echo(" Critical violations found: ". $row['critical'] .". ");
Remember that empty() does clever stuff for you.
empty('') == true
empty(0) == true
empty('0') == true
empty(1) == false
empty(2) == false
empty('foo') == false
I suspect you were just being bitten by a misconception of what empty() was supposed to do when you passed certain values to it.
isset() and empty() are subtly different.
Col
--
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/
Day Job:
Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
Mandriva Linux Contributor [http://www.mandriva.com/]
PulseAudio Hacker [http://www.pulseaudio.org/]
Trac Hacker [http://trac.edgewall.org/]