build multidimensional array from string