I have a string like this:
$string = \'one/two/three/four\';
which I turn it into a array:
$keys = explode(\'/\', $string);
$arr['one']['two']['three']['four'] = 'value'; $string = 'one/two/three/four'; $ExpCheck = explode("/", $string); $CheckVal = $arr; foreach($ExpCheck AS $eVal){ $CheckVal = $CheckVal[$eVal]??false; if (!$CheckVal) break; } if ($CheckVal) { $val =$CheckVal; }
this will give u your value in array.