Wednesday, October 23, 2019

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

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...