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.
<?php $a = bindec('1001'); var_dump($a); ?>
int(9)PHP 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 MCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More