Conditional Expression
syntax: IF (condition) { // do something !!! } elseIF (condition) { // do something else !!! } else { // do last result } switch ($gender) { case 'm': echo 'Male '; break; case 'f': echo 'Female '; break; default : echo 'You forgot to enter your gender ? '; break; } Logical Operator
Other Common Testing Functions String Slashing $comments = stripslashes( $comments ); Numerics If ( is_numeric($post)) returns a TRUE, If $post is a number or contains any valid numbers Empty String IF (empty ($_POST['name'])) returns a TRUE, If $_POST['name'] is empty or contains nothing or NO value at all, but NOT NULL String size IF (strlen ( $_POST['name']) > 0) returns a TRUE, If $_POST['name'] is not NULL or not Empty at all or contains a value either numberic or string or both Control Vales use isset to test, IF a control value had been set or even for testing Cookies ex.: If (isset($_POST['submit'])) ..... |

