$I = 453;
var_dump ( ($I / 100) * ($I / 10) * ($I % 10) );
function _my($chislo){
$chars = preg_split ( '//' , $chislo , - 1 , PREG_SPLIT_NO_EMPTY );
$rezalt = 1;
foreach($chars as $nuber){ $rezalt *= round($nuber); }
return $rezalt;
}
$chislo = 123;
print _my($chislo)."
";
$chislo = 234;
print _my($chislo)."
";
$chislo = 345;
print _my($chislo)."
";
$chislo = 456;
print _my($chislo)."
";
?>
Тестируем PHP
if( array_key_exists('number', $_POST) ){
$n = $_POST['number'];
$a = intdiv($n,100);
$b = intdiv($n,10)%10;
$c = $n%10;
echo $a*$b*$c;
} else {
?>