What is the function in PHP to convert a decimal number to a binary number?

To convert a decimal number to a binary number in PHP, you can use the built-in function decbin(). This function takes a decimal number as an argument and returns its binary representation. Simply pass the decimal number to the decbin() function, and it will output the binary equivalent.

$decimal_number = 10;
$binary_number = decbin($decimal_number);
echo "Binary representation of $decimal_number is: $binary_number";