Answers for "any 5 array function in php\"

PHP
1

common array methods php

$key_of_max_value = array_search(max($arrCompare),$arrCompare);
Posted by: Guest on May-06-2020
1

common array methods php

print_r(deep_delete_keys($arr,'country'));

function deep_delete_keys($arr, $keys) {
    if (!is_array($keys)) $keys = array($keys);
    $filteredArr = array_diff_key( $arr, array_flip( $keys ) );
    foreach ($filteredArr as &$val) {
        if (is_array($val)) {
            $val = deep_delete_keys($val, $keys);
        }
    }
    return $filteredArr;
}
Posted by: Guest on March-28-2020

Code answers related to "any 5 array function in php\"

Browse Popular Code Answers by Language