Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:36:20+00:00 2026-06-18T04:36:20+00:00

I am getting an array of data from a wordpress custom field with this

  • 0

I am getting an array of data from a wordpress custom field with this code:

<?php 
$values = get_field('google_location');
if($value) {
foreach($values as $value) {
echo $value;
}
}
?>

and here is the output from the array:

array(2) { ["coordinates"]=> string(22) "38.9974266,-77.1104762" ["address"]=> string(48) "8600 Old Georgetown Rd, Bethesda, Maryland 20814" }

array(2) { ["coordinates"]=> string(29) "37.7911347,-79.88268779999999" ["address"]=> string(26) "Arh Ln, Low Moor, VA 24457" }

array(2) { ["coordinates"]=> string(21) "38.9010559,-77.050792" ["address"]=> string(36) "900 23rd St NW, Washington, DC 20037" }

how do I grab the coordinates (long, lat) in these arrays from the string and insert them into li items. I want my HTML to look like this:

<ul>
    <li>38.9974266,-77.1104762</li>
    <li>37.7911347,-79.88268779999999</li>
    <li>38.9010559,-77.050792</li>    
</ul>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:36:21+00:00Added an answer on June 18, 2026 at 4:36 am

    So $value is pretty much all the data you’re getting. Because you just want to coordinates you’ll have something like this:

        <ul>
                <?php 
            $values = get_field('google_location');
            if($values) {
            foreach($values as $value) {
     echo  '<li>'. $value["coordinates"] .'</li>';
             }
            }
            ?>
    </ul>
    

    This should work. I didn’t check it, but it should work

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi need help getting repeated value from give array,below is the code which im
I'm getting an array of data from my model, and am using a php
I'm getting this kind of array of data from a server (it dynamically changes):
I have a problem getting my data from database and foreach it. This is
I am getting this data from JSON web services List ARRAY: ( { assets
I seem to have trouble with getting data from a php array, I've looked
by using print_r($_POST); i am getting data something like this Array ( [selected_friends] =>
I keep getting this error: DataTables warning: JSON data from server could not be
I am basically getting data from various APIs and using PHP to put them
I have code like this to show data from mysql, its to read data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.