Posted By

iloveitaly on 06/05/09


Tagged

php list check array keys exist


Versions (?)

array_keys_exist


 / Published in: PHP
 

like arraykeyexists but accepts an array of key values to check

  1. function array_keys_exist($keyArray, $array) {
  2. foreach($keyArray as $key) {
  3. if(!array_key_exists($key, $array))
  4. return false;
  5. }
  6.  
  7. return true;
  8. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: MMDeveloper on June 11, 2009

short, sweet, to the point, and has a valid everyday use.. nice.

You need to login to post a comment.