Re: Please have a look at proposed package draft : MultiArray
| From: | bertrand Gugger | Date: | Fri, 07 Jan 2005 12:23:32 +0000 |
| Subject: | Re: Please have a look at proposed package draft : MultiArray | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-35391@lists.php.net to get a copy of this message | ||
Hi Alan,
It's really something I need,
Just wrote a little version of same stuff a couple of days before.
Purpose is to give some open array or mixed interface to public methods.
That will be very soon proposed within my benchmark resources usage package.
So far your package is not including/requiring mass of scripts
or then, just if required further options,
I would be glad to use it instead of my poor method:
(it's only one step as here, array "depth" is limited to 2)
/**
* Transforms an array of arguments into a flat array (of strings)
* @access public
* @param array of mixed strings or array of strings, with optional string trailer
* @return array flat sections
*/
function makeArray($args) {
$what = array();
foreach ($args as $arg) {
if (!is_array($arg)) {
$arg = array($arg);
}
foreach ($arg as $elt) {
if (!$this->_sep) {
$what[] = $elt;
} else {
$what = array_merge($what, explode($this->_sep, $elt));
}
}
}
return $what;
}
I will take a look deeper in your scripts.
Bis gleich,
--
bertrand Gugger (toggg)
Selcuk Alan wrote:
>Hello everybody,
>
>I want to present you the class "MultiArray". It is a class, which can
>handle multidimensional arrays. See:
>http://www.pear.php.net/pepr/pepr-proposal-show.php?id=185
>
>For example it can sort and filter multidimensional arrays using several
>parameters, you can see it at work here:
>http://www.scalan.de/home/entwicklung/multiarray/beispiele/10737,10736,1,0.html
>
>Any and all comments and feedback are welcome.
>
>
>Greetings,
>
>Selcuk Alan
>
>
>