So far this code display all meta_value of ‘destination’ with the meta_key of ‘_map’. but the problem echo/print display as an array.
How to display only the list specific value such as ‘destination’ are CROATIA
UNITED STATE
VIETNAM.
Here is the code:
<?php
$map = get_unique_post_meta_values(‘_map’, ‘post’);
if($map){
foreach( $map as $destination){
echo $destination . ‘
‘ . “\n”;
}
}
?>
result display as: (only want to display the specific destination value.)
a:4:{s:8:”location”;s:15:”Zagreb, Croatia”;s:10:”desination”;s:7:”Croatia”;s:3:”lat”;s:10:”45.8150108″;s:4:”long”;s:18:”15.981919000000062″;}
a:4:{s:8:”location”;s:13:”North America”;s:10:”desination”;s:13:”United States”;s:3:”lat”;s:10:”54.5259614″;s:4:”long”;s:19:”-105.25511870000003″;}
a:4:{s:8:”location”;s:16:”Da Nang, Vietnam”;s:10:”desination”;s:7:”Vietnam”;s:3:”lat”;s:18:”16.054404866798798″;s:4:”long”;s:18:”108.20217474662707″;}