Convert multidimensional array to object while keeping the same structure

join shbcf.ru