Please answer this simple SPAM challenge: four minus four?
(Example: nine)

The Note You're Voting On

janturon at email dot cz
10 years ago
This is very common problem: set one variable to another, if it is not empty. If it is, set it to something else.
For example: set $bar to $foo, if $foo is empty, set $bar to "undefined";

if(!empty($foo)) $bar= $foo; else $bar= "undefined";

OR operator can shorten it:

$bar= @$foo or $bar= "undefined";

<< Back to user notes page

To Top