Jump to content

Having trouble adding element to an array


bpgillett

Recommended Posts

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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.