Code:
<?php
function array_get_key_val($key, $heystack) {
  if (is_array($heystack)) {
    foreach ($heystack as $k => $v) {
      if ($k == $key) {
        return $v;
      }
      elseif (is_array($v)) {
        return array_get_key_val($key, $v);
      }
    }
  }
  return FALSE;
}
?>

Last edited by shabbir; 14Nov2011 at 12:00.. Reason: Code blocks