Solved

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

Posted on 2013-06-07
1
464 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
1 Comment
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 300 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 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