$val ){ $nkey = $key; $isset = $t==0 ? isset( $to[$key] ) : isset( $to->$key ); if( ( $type==EXTR_SKIP && $isset ) || ( $type==EXTR_IF_EXISTS && !$isset ) ) continue; else if( ( $type==EXTR_PREFIX_SAME && $isset ) || ( $type==EXTR_PREFIX_ALL ) || ( $type==EXTR_PREFIX_INVALID && !preg_match( '#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$#', $key ) ) ) $nkey = $prefix.$key; else if( $type==EXTR_PREFIX_IF_EXISTS ) if( $isset ) $nkey = $prefix.$key; else continue; if( !preg_match( '#^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$#', $nkey ) ) continue; if( $t==1 ) if( $type & EXTR_REFS ) $to->$nkey = &$arr[$key]; else $to->$nkey = $val; else if( $type & EXTR_REFS ) $to[$nkey] = &$arr[$key]; else $to[$nkey] = $val; $i++; } return $i; } /** * array_is_indexed * a crud check if an array is an indexed array with the limitation that * it works for arrays where every element is as if it had been assigned doing $array[] = $value */ function array_is_indexed( $pArray ){ return (count(array_diff_key($pArray, array_values($pArray))) == 0); }