hrdyzlita Posted October 14, 2009 Share Posted October 14, 2009 Back again for a little help. This is probably a simple one, I'm just not seeing the problem. I want the my list to be on separate lines. It should read like this. My color is = Red My color is = Green My color is = Blue My color is = Cyan My color is = Magenta My color is = Black My color is = Yellow Total number of elements is = 7 <html> <head> <title>CREATING ARRAY AND FINDING OUT THE SIZE</title> </head> <body> <ul><li> <?php $color = array("Red", "Green", "Blue", "Cyan", "Magenta", "Black", "Yellow"); foreach ($color as $value) { echo "My color is = $value"; } $size = count($color); echo "Total number of elements is $size"; ?> </li></ul> </body> </html> Link to comment https://forums.phpfreaks.com/topic/177643-solved-php-color-list/ Share on other sites More sharing options...
trq Posted October 14, 2009 Share Posted October 14, 2009 <ul> <?php $color = array("Red", "Green", "Blue", "Cyan", "Magenta", "Black", "Yellow"); foreach ($color as $value) { echo "<li>My color is = $value</li>"; } $size = count($color); echo "<li>Total number of elements is $size</li>"; ?> </ul> Link to comment https://forums.phpfreaks.com/topic/177643-solved-php-color-list/#findComment-936670 Share on other sites More sharing options...
hrdyzlita Posted October 14, 2009 Author Share Posted October 14, 2009 Thank you so so so very much! Link to comment https://forums.phpfreaks.com/topic/177643-solved-php-color-list/#findComment-936674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.