bindec() function in PHP

PHPProgrammingServer Side Programming

The bindec() function convert a binary number to decimal number.

Syntax

bindec(bin_str)

Parameters

  • bin_str − The binary string to convert

Return

The bindec() function returns decimal value of the specified string bin_str

Example

 Live Demo

<?php
   echo bindec("1101");
?>

Output

The output displays that the bindec() function returns a decimal value:

13
raja
Updated on 26-Jun-2020 09:42:52

Advertisements