troubleshooting Question

PHP Multidimensional array show only one value

Avatar of acbv
acbvFlag for Canada asked on
Web Development
5 Comments1 Solution447 ViewsLast Modified:
Hello I have this array:
 [41] => Array
        (
            [type] => locations
            [name] => LOCATION
            [keyword] => Array
                (
                    [5] => City
                    [4] => Region
                    [3] => Regional District
                    [2] => Province
                    [1] => LOCATION1
                )

            [value] => Array
                (
                    [5] => Grande Prairie
                    [4] => Grande Prairie
                    [3] => Grande Prairie
                    [2] => Alberta
                    [1] => Canada
                )
How can I modify this code in order to show only the city?:

foreach ($property[41]['value'] as $ind=>$lval)
            {
                  $location_string .= $lval .', ';
            }
Thanks!!!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros