sonnyj7
-
Posts
2 -
Joined
-
Last visited
Posts posted by sonnyj7
-
-
Let's assume that there is an EMPTY "$flavors" array that has already been established...Here's the problem:
(I can't seem to figure this out -THIS IS AN EXERCISE)
Here's the STARTER code to the problem:
<?php
$recommendations = array();// This is the code that I added$flavors = array()$flavors = array("Avocado Chocolate");?><html><body><h1>Flavor Recommendations</h1><?php if (!empty($flavors)) {echo '<ul><?php foreach ($recommendations as $flavor) { ?><li><?php echo $flavor; ?></li><?php } ?></ul>' ;} else {echo '<p>There are no flavor recommendations for you.</p>';}?></body></html> -
I'm an aspiring PHP developer, hoping to gain valuable knowledge and feedback. So guys and gals, how do I ask a question? I really could use some help with a programming exercise I am working on...
Echo value from one array, based on the result of conditional involving another array...
in PHP Coding Help
Posted
Thanks for the clarity EmilsM!