PHPize Online / SQLize Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE somewhere ( id INT AUTO_INCREMENT, name VARCHAR(100), PRIMARY KEY (id) ); INSERT INTO somewhere(id, name) VALUES (1, 'Chad'), (4, 'Ned'), (5, 'Dave'), (14, 'Newt'), (18, 'Bill'), (21, 'Norton'), (25, 'Alan');
Copy
Copy Format Clear
<?php function isNullOrUndefined($variable_name) { global $$variable_name; if (!isset($$variable_name) || is_null($$variable_name)) { return true; } return false; } $foo = "foo"; $bar = null; echo isNullOrUndefined("foo"); //false echo '\n'; echo isNullOrUndefined("bar"); //true //echo '<br>'.isNullOrUndefined("baz") //true
Show:  
Copy