Performing the intersection of two sets?
$ezpageSettings[$type] = array_intersect_key( $ezpageSettings[$type], array_flip( $ezpageSettings[$enabledKey] ) );