public static function arrayList(array $array, $key, $value)
    {
        $result = array();

        foreach ($array as $row) {
            if (array_key_exists($key, $row) && array_key_exists($value, $row)) {
                // References
                $name =& $row[$key];
                $text =& $row[$value];

                $result[$name] = $text;

            } else {
                trigger_error(sprintf('Nested arrays must contain both %s and %s', $key, $value));
            }
        }

        return $result;
    }
public static function arrayList(array $array, $key, $value)
    {
        $result = array();

        foreach ($array as $row) {
            if (array_key_exists($key, $row) && array_key_exists($value, $row)) {
                // References
                $name =& $row[$key];
                $text =& $row[$value];

                $result[$name] = $text;

            } else {
                trigger_error(sprintf('Nested arrays must contain both %s and %s', $key, $value));
            }
        }

        return $result;
    }
public static function arrayList ( array $ array , $ key , $ value ) { $ result = array ( ) ; foreach ( $ array as $ row ) { if ( array_key_exists ( $ key , $ row ) && array_key_exists ( $ value , $ row ) ) { // References $ name = & $ row [ $ key ] ; $ text = & $ row [ $ value ] ; $ result [ $ name ] = $ text ; } else { trigger_error ( sprintf ( 'Nested arrays must contain both %s and %s' , $ key , $ value ) ) ; } } return $ result ; }
Turns array's row into a list

@param array $array Target array
@param string $key Column's name to be used as a key
@param string $value Column's name to be used as a value
@return array
Turns array s row into a list