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
Get step-by-step solutions from verified subject matter experts
