|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34526 array-related operation to "reduce" contained items
Submitted: 2005-09-16 14:01 UTC Modified: 2013-03-15 14:53 UTC
From: soletan at toxa dot de Assigned:
Status: Duplicate Package: *General Issues
PHP Version: 5.0.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: soletan at toxa dot de
New email:
PHP Version: OS:


 [2005-09-16 14:01 UTC] soletan at toxa dot de
Is it possible to have an array_xxxx-method to perform the transformation on arrays as given below. Since I am working with DBs and wrapping records of tables using classes I often
get the case to receive an array as given below and require
to pass the list of IDs, only.

For sure I can do the transformation all by myself in PHP using foreach. But since my software is getting more and more complex I appreciate any chance to increase my scripts' performance by having such trivial tasks being done in one step.

Reproduce code:
    array( 'id' => 1, 'foo' => 'bar' ),
    array( 'id' => 2, 'foo' => 'bar' ),
    array( 'id' => 3, 'foo' => 'bar' ),
    array( 'id' => 4, 'foo' => 'bar' ),
    array( 'id' => 5, 'foo' => 'bar' )

$out = array_xxxxx( $in, 'id' );

array( 1, 2, 3, 4, 5 );


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-03-15 14:53 UTC]
-Status: Open +Status: Duplicate -Package: Feature/Change Request +Package: *General Issues
 [2013-03-15 14:53 UTC]
Duplicate of
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Sep 24 23:05:52 2022 UTC