FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Fast/Easy way to extract a column from multi-dimensional array?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Fast/Easy way to extract a column from multi-dimensional array? [message #176833 is a reply to message #176831] Fri, 27 January 2012 20:52 Go to previous messageGo to previous message
Thomas Mlynarczyk is currently offline  Thomas Mlynarczyk
Messages: 131
Registered: September 2010
Karma:
Senior Member
John Drako schrieb:
> I'm looking for a way to get all the values from the column of a two
> dimensional array.

> RecordID, name, last name, title
> RecordID, name, last name, title
> RecordID, name, last name, title
> RecordID, name, last name, title
> RecordID, name, last name, title
> RecordID, name, last name, title
> etc...
>
> I need to get all the 'RecordID' from the results to reuse in other
> queries.

If it's the first column you're interested in:

array_map( 'current', $array )

Greetings,
Thomas

--
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: approaches to PHP-based application interface?
Next Topic: php+html mixup in displaying multidimensional array in html tables
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 12 21:35:55 GMT 2024

Total time taken to generate the page: 0.03690 seconds