Solved

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

Posted on 2013-06-07
1
450 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 51

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now