Input Array : Input array is like below and level in it can be dynamic up to any level,
$array_input = [ 0 => ["level" => "L1