Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get the first column third data  from a two dimensional array  in php

Posted on 2013-06-07
1
Medium Priority
?
485 Views
Last Modified: 2013-06-07
Hi i have array of records. i want to get 1st column 3rd record. How i will get it by PHP? here is the array

Array
(
    [id] => 1623
    [name] => BELLEVUE HOSPITAL CENTER
    [address] => FIRST AVENUE AT 27TH STREET
    [lat_centroid] => 40.7445
    [long_centroid] => -73.9782
    [query_string] => bellevue-hospital-center
    [city_name] => New York
    [postal] => 10016
    [phone] => (212) 561-4132
}

i want to get
[lat_centroid] => 40.7445
[long_centroid] => -73.9782

How will i do ? pls help me
0
Comment
Question by:krushnac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 59

Accepted Solution

by:
Julian Hansen earned 1200 total points
ID: 39228351
the samples you gave are 3rd and fourth columns

Why not just use this?

For the fields in the first record

$arrayname[0]['lat_centroid']
$arrayname[0]['long_centroid']

And the second

$arrayname[1]['lat_centroid']
$arrayname[1]['long_centroid']

etc
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question