write a php program that multiplies corresponding elements of two given lists in PHP

PHP
7
$a = array(1, 2, 3);
$b = array(4, 5, 6);
$c = array();
for ($i=0; $i<count($a); $i++) {
$c[$i] = $a[$i] * $b[$i];
}
print_r($c);
🤖 Code Explanation
This code is written in PHP. It multiplies each element in array $a with the corresponding element in array $b. The result is stored in array $c. Finally, it prints out array $c.

More problems solved in PHP




















