Definition: The Is_Binary () PHP function is used to check if a number is binary. Binary numbers are also called base two. This function will return true or false. If you need a number to be binary and it is not, you can use the base_convert () function to make it binary.
Also Known As: Is Binary, Binary check
Examples:
<?php
if (is_binary (1001))
{
echo "Yes";
} else {
echo "No";
}
?>
Since 1001 is the binary version of 9, this will echo "Yes." <?php
if (is_binary (1201))
{
echo "Yes";
} else {
echo "No";
}
?>
Since 1201 is not binary, this will echo "No."

