array_diff_key() for PHP4


/ Published in: PHP
Save to your folder(s)

Fallback Function for versions earlier then php5


Copy this code and paste it in your HTML
  1. if (!function_exists('array_diff_key'))
  2. {
  3. function array_diff_key()
  4. {
  5. $arrs = func_get_args();
  6. $result = array_shift($arrs);
  7. foreach ($arrs as $array) {
  8. foreach ($result as $key => $v) {
  9. if (array_key_exists($key, $array)) {
  10. unset($result[$key]);
  11. }
  12. }
  13. }
  14. return $result;
  15. }
  16. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.