bindec() function in PHP


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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 26-Jun-2020

63 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements