Checking “$zipcode”


"; // Check for < 5 characters if (strlen ($zipcode) < 5) { ++$failures; echo "

Warning: “$zipcode” is less than 5 characters

"; } // Check for > 5 characters if (strlen ($zipcode) > 5) { ++$failures; echo "

Warning: “$zipcode” is more than 5 characters

"; } // Check for numbers if (!is_numeric($zipcode)) { ++$failures; echo "

Warning: “$zipcode” contains non numeric characters

"; } if ($failures == 0) echo "

“$zipcode” is valid

"; else echo "

“$zipcode” is not valid

"; } ?>