FUNKAM35 Posted April 14, 2014 Share Posted April 14, 2014 $places = array("Birmingham","Cornwall","Leeds","London","Manchester"); hi, I have a list of $global in the variables file how do I get these to display in a list I have only done select before when theya re ina table not in a set globals like these Thanks Link to comment https://forums.phpfreaks.com/topic/287757-globals-how-do-i-array-globals/ Share on other sites More sharing options...
Psycho Posted April 14, 2014 Share Posted April 14, 2014 Not sure what you are really saying. Your code shows you have defined a variable $places as an array. What does the $global variable have to do with it? Create a list echo "<ul>\n"; foreach($places as $place) { echo "<li>{$place}</li>\n"; } echo "<ul>\n"; Link to comment https://forums.phpfreaks.com/topic/287757-globals-how-do-i-array-globals/#findComment-1476068 Share on other sites More sharing options...
FUNKAM35 Posted April 14, 2014 Author Share Posted April 14, 2014 Hi, I see dont know why but thought the defined $places as variables was known as $globals Many thanks will try your code Link to comment https://forums.phpfreaks.com/topic/287757-globals-how-do-i-array-globals/#findComment-1476095 Share on other sites More sharing options...
FUNKAM35 Posted April 19, 2014 Author Share Posted April 19, 2014 woohoo it works many thanks, learn something new every day on here!! Link to comment https://forums.phpfreaks.com/topic/287757-globals-how-do-i-array-globals/#findComment-1476666 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.