Retrieve values from an array
-
Hi,
I’ve spent 2 days going crazy trying to retrieve a couple of vlaues from an array so I can display a google map.
I may end up re-wrting the way that users submit the form but if someone can offer a bit of advice first then it will be ideal.
The co-ordinates are sotred in an array called markers I know that the co-ordinates are being stored because when I run the following code;
$custom_fields = get_post_custom_values('twitcher'); $my_custom_field = $custom_fields; foreach ( $my_custom_field as $key => $value ) echo "Retrieve co-ordinates - " . $key . " => " . $value . "<br />";
I get all the correct values printed out as such:
Retrieve co-ordinates – 0 => a:9:{s:5:”title”;s:2:”zx”;s:4:”date”;s:10:”27/08/2012″;s:4:”body”;s:3:”xxz”;s:7:”markers”;a:1:{i:0;a:2:{i:0;s:7:”51.6317″;i:1;s:7:”-3.0378″;}}s:4:”zoom”;s:1:”7″;s:10:”image_file”;s:19:”twitcher_image_file”;s:8:”category”;s:3:”268″;s:4:”name
What I need to do is pull out those marker co-ordinates so I can send them to the google api.
anyone help?
thanks
Kevin
- The topic ‘Retrieve values from an array’ is closed to new replies.