I'm trying to make it translate binary
<?php
//get the variable
$code = $_POST['bicode'];
//make sure they are numbers
$check = ereg ("^[01]+", $code);
//With an if statment
If ($check){
//Start the code to interpret it
$chars = count($code);
//start the loop
for ($a = 0; $a < $chars; $a++) {
//Make another variable, an excuse for a, just for caution
$b = $a;
//We need to start the answer somewhere
$answer = 1;
//Make another for loop so you can times it by powers (I need help here)
for ($z=0; $z < $a; z++){
//Take the number and multiply by itself
$answer = $answer * $code[$b];
}
//Tell them what it is
echo "$answer";
}
//If it's not proper, tell them so
else{
echo "This is not proper binary code";
}
?>