I have a function i.e
function cdec($num) {
for ($n = 0 ; $n < strlen($num) ; $n++) {
$temp = $num[$n];
$dec = $dec + $temp*pow(2 , strlen($num) – $n – 1);
}
return $dec;
}
When I am going to run my code then it is showing me this error
Parse error: syntax error, unexpected '–' (T_STRING)
I don't understand where is my fault. It is showing error in this line
$dec = $dec + $temp*pow(2 , strlen($num) – $n – 1);