FUNCTION
is_numeric() True if number or numeric string
ctype_digit() True if all digits are numeric characters
is_bool() True if variable is a Boolean
is_null() True if variable is NULL
is_float() True if variable type is a fl oat
is_double() True if variable type is a double
is_int() True if variable type is integer
is_string() True if variable type is string
is_object() True if variable is an object
is_array() True if variable is an array
<?php
$b = 3;
$c = 0;
$d = ‘0’;
$e = ‘xyz3’;
if ($c != 0) {
echo $b/$c . ‘<br />’;
} else {
echo ‘Cannot divide by 0. <br />’;
}
echo ($c != 0) ? $b/$c : ‘Cannot divide by 0.<br />’;
echo ($d != 0) ? $b/$d : ‘Cannot divide by 0.<br />’;
echo ($e != 0) ? $b/$e : ‘Cannot divide by 0.<br />’;
?>
If you have display_errors on, the
user sees the error message. If you are logging errors, it is logged. You can use the E_USER_NOTICE
level to post informational notices that do not affect the processing, E_USER_WARNING level for
errors that allow processing to continue, or E_USER_ERROR to stop the processing.
is_numeric() True if number or numeric string
ctype_digit() True if all digits are numeric characters
is_bool() True if variable is a Boolean
is_null() True if variable is NULL
is_float() True if variable type is a fl oat
is_double() True if variable type is a double
is_int() True if variable type is integer
is_string() True if variable type is string
is_object() True if variable is an object
is_array() True if variable is an array
<?php
$b = 3;
$c = 0;
$d = ‘0’;
$e = ‘xyz3’;
if ($c != 0) {
echo $b/$c . ‘<br />’;
} else {
echo ‘Cannot divide by 0. <br />’;
}
echo ($c != 0) ? $b/$c : ‘Cannot divide by 0.<br />’;
echo ($d != 0) ? $b/$d : ‘Cannot divide by 0.<br />’;
echo ($e != 0) ? $b/$e : ‘Cannot divide by 0.<br />’;
?>
If you have display_errors on, the
user sees the error message. If you are logging errors, it is logged. You can use the E_USER_NOTICE
level to post informational notices that do not affect the processing, E_USER_WARNING level for
errors that allow processing to continue, or E_USER_ERROR to stop the processing.