gammaman Posted April 27, 2008 Share Posted April 27, 2008 Is there a way to code something that does While a variable that is an array still has elements. Link to comment https://forums.phpfreaks.com/topic/103159-while-a-variable-array-still-has-elements/ Share on other sites More sharing options...
p2grace Posted April 27, 2008 Share Posted April 27, 2008 while(count($array) > 0){ } Link to comment https://forums.phpfreaks.com/topic/103159-while-a-variable-array-still-has-elements/#findComment-528416 Share on other sites More sharing options...
hitman6003 Posted April 27, 2008 Share Posted April 27, 2008 or using empty: while (!empty($array)) { $current_element = array_pop($array); echo $current_element; } http://www.php.net/empty Link to comment https://forums.phpfreaks.com/topic/103159-while-a-variable-array-still-has-elements/#findComment-528438 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.