I have an array like so which is built automatically and dynamic in length.
$arr = array('k1','k2','k3','k4',);
And I have an already existing array $exArr, how can I check dynamically the same as doing this below;
if($exArr[$arr[0]][$arr[1]][$arr[2]][$arr[3]]) echo 'IT EXISTS';
Bearing in mind that the dynamically built array could have just one or up to and over 10 sequential keys to check.
Thanks
EDIT
To be more clear I have an array which is dynamic but will only contain values. It could be any length.
The dynamically built array corresponds with another array's keys, I need a way to check that all the values in the dynamically built array are correct and point to a value, example;
$dynamic = array('one', 'two', 'three');
$existing = array('one' => array('two' => array('three' => array(true))));
The above would evaluate to true as the statement below is correct,
if($existing[$dynamic[0]][$dynamic[1]][$dynamic[2]]) echo 'WOO';
The trouble I am having is that the dynamic array is just that! It could be one in length or 50. So having a plain old if statement isn't going to work here.
Thanks again
in_array?count? php.net/manual/en/function.count.php