<?php
$path = $_GET['path'];
$save_path = $_SESSION['pathDirectory'];
$new_path = array();
for ($x = 0; $x <= $path; $x++) {
    $new_path[$x] = $save_path[$x];
}
$_SESSION['selectedDirectory'] = $new_path[$path]['id'];
$_SESSION['pathDirectory'] = $new_path;
