The most efficicient way to pick key,value from a large array
| From: | Netroby | Date: | Thu, 18 Jun 2015 01:24:20 +0000 |
| Subject: | The most efficicient way to pick key,value from a large array | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-86740@lists.php.net to get a copy of this message | ||
Now, we have a large array, contains user profile.
[uid, username, password, email, qq, msn, skype, address, zipcode,
telphone, mobile.......]
We need to pick information from this big array, and we know the key
we want to pick.
What's the efficient way ? Is there any function like
$pending_pick_key1 = [uid, username];
array_pick($origin_array, $pending_pick_key1); //return array
contains [uid, username]
$pending_pick_key2 = [username, password];
array_pick($origin_array, $pending_pick_key2); //return array contains
[username, password]
we current using array_filter and pass function into it to do this job.
But it's not fast as we test.
Any other ideas beside array_filter?
Or we have to implement an php extension to do this job ?
Sorry for trouble you. need your help.
Appreciate your time.
----------------------------
Netroby