This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function set_deep_index_value(&$data,$data_indexes,$new_value){ | |
foreach ($data_indexes as $index){ | |
if($index == sizeof($data_indexes)-1) $data[$index]=$new_value; | |
else return set_deep_index_value($data[$index],array_slice($data_indexes,1),$new_value); | |
} | |
} | |
function persist_config($target,$new_value = null) { | |
if(is_array($target) && sizeof($target) == 1){ | |
$new_value = array_values($target)[0]; |