On Wed, May 23, 2001 at 12:27:04AM +0200, Gyozo Papp wrote :
> Thanks for your fast reply.
> One more question related to this topic.
> Would it be valueable to extend the existing array_values()
> function to support this feature? just to balance with
> array_keys() and its optional value argum
t; <[EMAIL PROTECTED]>
To: "Gyozo Papp" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: 2001. május 23. 00:14
Subject: Re: [PHP] select specified elements from an array
> On Wed, May 23, 2001 at 12:06:42AM +0200, Gyozo Papp wrote :
> > function array_part($fromar
On Wed, May 23, 2001 at 12:06:42AM +0200, Gyozo Papp wrote :
> function array_part($fromarray, $keys)
> {
> foreach($fromarray as $key => $val)
> {
> if (in_array($key, $keys)
>$anotherarray[$key] = $val;
> }
> return $anotherarray;
> }
foreach( $keys as $key)
hello,
I'd like to know if there is a more elegant and smoother way to retrieve some array
elements with given keys and put them into an other array.
Yes, I can write a function like the following, but maybe I missed some new PHP
awesome feature or array function which does this job.
So, is the
4 matches
Mail list logo