Tuesday, July 24, 2018

php syntax error on line 9

I have been staring at this for an hour now. It says I have an
Parse error: syntax error, unexpected '{' in line 9.



Could someone please look at this for me. Thanks in advance.




if(isset($_POST['submit']))

{
function foo($a, $b)
{
foreach(array_keys($a) as $i)
{
if(array_key_exists($i, $b){
$result[$i] = $a[$i]*$b[$i];
}else{
$result[$i] = 0;
}

}
foreach(array_keys($b) as $i)
{
if(not array_key_exists($i, $a){ //exists in b but not i a
$result[$i] = 0;
}
}
return $result
}
}


?>

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...