Re: [PHP] select specified elements from an array

2001-05-22 Thread Markus Fischer
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

Re: [PHP] select specified elements from an array

2001-05-22 Thread Gyozo Papp
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

Re: [PHP] select specified elements from an array

2001-05-22 Thread Markus Fischer
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)