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)
        if( isset( $fromarray[ $key]))
                $anotherarray[ $key] = $fromarray[ $key];

- Markus

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to