Question: The following code generates a syntax error or errors. The purpose of the line of code is to create an associative array and store it

The following code generates a syntax error or errors. The purpose of the line of code is to create an associative array and store it in the $resultPet variable. Which rewrite of the line will correct the error or errors ?

$result Pet = ('name' = 'scratchy', 'type' = 'cat', 'age' = 3);

$result pet = array('name' => 'scratchy', 'type' => 'cat', 'age' = 3);
$resultPet = array('name' => 'scratchy', 'type' => 'cat', 'age' => 3);
$resultPet = new array('name' => 'scratchy', 'type' => 'cat', 'age' => 3);
$resultPet = ('name' -> 'scratchy', 'type' -> 'cat', 'age' = 3);
$result pet = array('name' => 'scratchy', 'type' => 'cat', 'age' => 3);
$result Pet = ('name' => 'scratchy', 'type' => 'cat', 'age' = 3);
$result Pet = array('name' => 'scratchy', 'type' => 'cat', 'age' => 3);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!