Please tell me how you can implement the conversion of a number from a binary number system to a decimal, so that it is recorded as the sum of the degrees of the binary number system to the corresponding number in the system discharge.
What you need to add
<?php $i = '101'; function myBin2Dec($i) { sum k[i](2^(i)); i = {0; ->} //направление разбора строки с представленным двоичным числом, с права на лево. где i элемент последовательности. k значение iго элемента echo "=======\n<br>i = ".i."; base = 10\n</br>=======</br>"; } $result = myBin2Dec($i); echo "result = ".$result."\n</br>"; ?>