Is there an equivalent build-in function to that one? (even without the test capability)
/**
* extracts a column from a 2D associative array, with an optional selection over another column
*
* @param $aArray array to extract from
* @param $aColName name of the column to extract, ex. 'O_NAME'
* @param $aColTest (optional) name of the column to make the test on, ex. 'O_ID'
* @param $aTest (optional) string for the test ex. ">= 10", "=='".$toto."'"
* @return 1D array with only the extracted column
* @access public
*/
function extractColFromArray($aArray, $aColName, $aColTest="", $aTest="") {
$mRes = array();
foreach($aArray as $row) {
if (($aColTest == "") || (eval("return " . $row[$aColTest] . $aTest . ";" )) ) {
$mRes[] = $row[$aColName];
}
}
return $mRes;
} // extractColFromArray
Alex