Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $binario = "1101"; # El 13 en binario
- # Con el 2 indicamos que la cadena que le pasamos está en base 2
- $decimal = intval($binario, 2);
- echo $decimal; # Imprime 13
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement