Solved

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

Posted on 2013-06-07
1
478 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 58

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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

627 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