Hi,
I can't seem to get a simple "if" instruction to work:
if ($thisvar and !somefunc()) { ... }
When $thisvar is true, it always executes the conditional code, no matter the value returned by somefunc().
What am I doing wrong?
Thanks in advance.
Correct use for "if (this and that) {}"
Moderator: General Moderators
It doesn't really answer your question but have you tried setting the output of the function to some variable and then test that instead ie
this way you can try and debug by echoing out $anothervar and seing what it looks like. (not that you can't just echo out the somefunction() anyway)
Code: Select all
$anothervar = somefunction();
if ($thisvar and !$anothervar) { ... }- Sevengraff
- Forum Contributor
- Posts: 232
- Joined: Thu Apr 25, 2002 9:34 pm
- Location: California USA
- Contact: