Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4649

Re: Fast/Easy way to extract a column from multi-dimensional array?

From Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de>
Newsgroups comp.lang.php
Subject Re: Fast/Easy way to extract a column from multi-dimensional array?
Date 2012-01-27 23:49 +0100
Organization albasani.net
Message-ID <jfv9lu$ql4$1@news.albasani.net> (permalink)
References <jfv06v01hoa@news6.newsguy.com> <jfv2pk$aot$1@news.albasani.net> <1574609.VNBv5SFTvI@PointedEars.de>

Show all headers | View raw


Thomas 'PointedEars' Lahn schrieb:
>> array_map( 'current', $array )
> 
> array_map() it is, but one should not rely on that the array cursor is at 
> the first element.

True. And I just remembered that the reset() function conveniently 
returns the first element of the array, thus:

array_map( 'reset', $array )

But I admit that a custom function would be more flexible.

Greetings,
Thomas


-- 
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fast/Easy way to extract a column from multi-dimensional array? John Drako <jbravo556@gmail.removethis.com> - 2012-01-27 15:08 -0500
  Re: Fast/Easy way to extract a column from multi-dimensional array? "J.O. Aho" <user@example.net> - 2012-01-27 21:50 +0100
    Re: Fast/Easy way to extract a column from multi-dimensional array? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-27 22:49 +0100
  Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-01-27 21:52 +0100
    Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 22:42 +0100
      Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 22:55 +0100
      Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-01-27 23:49 +0100
  Re: Fast/Easy way to extract a column from multi-dimensional array? Jeff North <jnorthau@yahoo.com.au> - 2012-01-28 13:52 +1100
    Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-28 21:28 +0100
  Re: Fast/Easy way to extract a column from multi-dimensional array? Arno Welzel <usenet@arnowelzel.de> - 2012-01-28 09:49 +0100
    Re: Fast/Easy way to extract a column from multi-dimensional array? John Drako <jbravo556@gmail.removethis.com> - 2012-01-29 13:54 -0500

csiph-web