The best way to do it is to use a recursive function (since your array is multidimensional). Since your keys are not defined upfront, a key name should be a param to this function. I assume sub_items is defined upfront as the key to the array holding sub-elements.
I would use something like this ($arr is an array on current level, notice the & in arguments forcing to pass arrays by reference):
//function definition for use later
function remove_element_by_key ($keyName, $keyValue, & $arr = array()) {
//$arr is our current array, $ind is numerical index, $data is an array to compare keys
foreach ($arr as $ind => & $data) {
//check if current element is what we are looking for, ie. has 'id' => 6,
//and remove it if it is
if (array_key_exists($keyName, $data) && $data[$keyName] == $keyValue) {
unset($arr[$ind]);
}
//if not - search it's subelements
elseif (array_key_exists('sub_items', $data)) {
remove_element_by_key($keyName, $keyValue, $data['sub_items']);
}
}
}
//and after definition just use this:
remove_element_by_key('id', 6, $yourWholeArray);
I haven't tested it, but this is surely the way to go.