Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
PHP decbin() Function
Definition and Usage
The decbin() function returns a string that contains binary equivalent of given decimal number argument.
This function returns a string with binary digits.
Syntax
decbin ( int $number ) : string
Parameters
| Sr.No | Parameter & Description |
|---|---|
| 1 |
number A decimal number to be converted in equivalent binary representation |
Return Values
PHP decbin() function returns a binary number inside string.
PHP Version
This function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.
Example
<?php
$arg=-10;
$val=decbin($arg);
echo "decbin(" . $arg . ") = " . $val;
?>
Output
This will produce following result −
decbin(-10) = 1111111111111111111111111111111111111111111111111111111111110110
Advertisements
