bpgillett Posted July 19, 2009 Share Posted July 19, 2009 hi. i have an array, 'output_array Link to comment https://forums.phpfreaks.com/topic/166479-having-trouble-adding-element-to-an-array/ Share on other sites More sharing options...
Amtran Posted July 19, 2009 Share Posted July 19, 2009 What? You can't seriously expect us to help you with a 6 word explanation, can you! Link to comment https://forums.phpfreaks.com/topic/166479-having-trouble-adding-element-to-an-array/#findComment-877899 Share on other sites More sharing options...
bpgillett Posted July 19, 2009 Author Share Posted July 19, 2009 hi. i have an array called output_array for which i walk to run a function on each element that extracts desired text and adds the text to a separate array called location_details_array. the function should then add the respective 'location_details_array' for each element of the main array (output_array) to a multidimensional array called multi_locations_array. however, the array_walk properly creates a location_details_array for each element but will not add it to the multidimensional array i can't figure out what's wrong with my syntax. thanks. --brian function extract_desired_elements($value, $key){ $location_details_array[name] = get_string_between_tags($value,"<Placemark><name>","</name>"); $location_details_array[address] = get_string_between_tags($value,"<address>","<br/>"); $location_details_array[coordinates] = = get_string_between_tags($value,"<Point><coordinates>","</coordinates></Point>"); $multi_locations_array[] = $location_details_array; } Link to comment https://forums.phpfreaks.com/topic/166479-having-trouble-adding-element-to-an-array/#findComment-877907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.