hi Matthias,
if ($test)ist äquivalent zuif ($test != ""). D
Das ist eigentlich nicht ganz korrekt. Der Inhalt von $test wird zu einer boolschen Variable gecastet:
When converting to boolean, the following values are considered FALSE:
 the boolean FALSE itself
 the integer 0 (zero)
 the float 0.0 (zero)
 the empty string, and the string "0"
 an array with zero elements
 an object with zero member variables (PHP 4 only)
 the special type NULL (including unset variables)
SimpleXML objects created from empty tags
$test != "" ist in dem Sinne noch irreführender, weil da $test wiederum gecastet wird, weil es "!=" statt "!==" ist.
Aus meiner Sicht macht "!=" in Javascript (s. Crockford) wie auch in PHP keinen Sinn. (s.a. http://forum.de.selfhtml.org/archiv/2013/10/t215185/#m1474005).
mfg
tami
 nicht angemeldet
 nicht angemeldet Matthias Apsel
 Matthias Apsel Der Martin
 Der Martin