Question: / * 0 9 : Use the set _ species method on each pet instance from above. - $pet 1 is a Cow - $pet
: Use the setspecies method on each pet
instance from above.
$pet is a "Cow"
$pet is a "Dog"
$pet is a "Duck"
Afterwards, create a $petArray that contains
all 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
Not sure about the reverse?
Look at the PHP docs.
$petsetspeciesCow;
$petsetspeciesDog;
$petsetspeciesDuck;
$petArray $pet $pet $pet;
foreach arrayreverse$petArray as $pet
echo $petgetname;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
