Question: / * 0 9 : Use the set _ species method on each pet instance from above. - $pet 1 is a Cow - $pet

/*09: Use the set_species method on each pet
instance from above.
- $pet1 is a "Cow"
- $pet2 is a "Dog"
- $pet3 is a "Duck"
Afterwards, create a $petArray that contains
all 3 pet instances.
Loop through the array in reverse order
and output the name value for each pet
object in the array in a list item nested
inside of the list item with id of 9.
Not sure about the reverse?
Look at the PHP docs.
*/
$pet1->set_species("Cow");
$pet2->set_species("Dog");
$pet3->set_species("Duck");
$petArray =[$pet1, $pet2, $pet3];
foreach (array_reverse($petArray) as $pet){
}echo $pet->get_name()."";

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!