Example There is a variable (123.4234.1.3.) I need explode this (.) And multiply 123 4234 1 3
$formatted="123.4234.1.3.";
$parcalar = explode(".", $formatted);
foreach($parcalar as $element),
how can i continue
Example There is a variable (123.4234.1.3.) I need explode this (.) And multiply 123 4234 1 3
$formatted="123.4234.1.3.";
$parcalar = explode(".", $formatted);
foreach($parcalar as $element),
how can i continue
$formatted="123.4234.1.3.";
$numbers = explode(".", $formatted);
$mul = array_reduce($numbers, function ($carry, $value) {
if ($value === "") { // skip empty values
return $carry;
}
return $carry * $value;
}, 1);
var_dump($mul);
Output:
int(1562346)
array_reduce
anyone? :D