php

How to Convert Binary to Decimal in PHP?

To convert a binary number to its decimal value, the bindec() function is used. It expects a string containing the binary number as a parameter and returns the decimal value as integer.
 

Example :
<?php
    $a = bindec('1001');
    var_dump($a);
?>

Output:

int(9)
PHP MCQ - Multiple Choice Questions and AnswersPHP MCQ – Multiple Choice Questions and Answers – Basics – Part 1This collection of PHP Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “PHP basic”.   1. In PHP, variables…Read More
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *