Visite Webhosting Latino, el site sobre alojamiento web.
#34526 : array-related operation to "reduce" contained items - Mombu the Php Forum
Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #34526 : array-related operation to "reduce" contained items
User Name
REGISTER NOW! Mark Forums Read

sponsored links

1 14th April 20:53
External User
Posts: 1
Default #34526 : array-related operation to "reduce" contained items

From: soletan at toxa dot de
Operating system: Linux
PHP version: 5.0.5
PHP Bug Type: Feature/Change Request
Bug description: array-related operation to "reduce" contained items

Is it possible to have an array_***x-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_***xx( $in, 'id' );

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

Edit bug report at
Try a CVS snapshot (php4):
Try a CVS snapshot (php5.0):
Try a CVS snapshot (php5.1):
Fixed in CVS:
Fixed in release:
Need backtrace:
Need Reproduce Script:
Try newer version:
Not developer issue:
Expected behavior:
Not enough info:
Submitted twice:
PHP 3 support discontinued:
Daylight Savings:
IIS Stability:
Install GNU Sed:
Floating point limitations:
No Zend Extensions:
MySQL Configuration Error:
  Reply With Quote

  sponsored links


Thread Tools
Display Modes

Copyright 2006 - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -