Dear ali and diego,
the most correct one is diego's (he got my question :-) )
<?
$number="123456789";
$product=0;
for($i=0;$i<strlen($number);$i++){
$product += $number[$i] * pow(2,8-$i);
}
print $product;
?>
this is the correct one, but I need one final correction.
I want to make the calculations up to the 8th digit. The proper result should be 1004.
And how can I make the $number be user-defined? the number comes from a form with name=afm
thanks guys for all the help