There is such code:
Foreach ($_SESSION[explode] as $explode) { $tr[] = '<td>'. $explode[name].'</td>' <td>'. $explode[filial].'</td>' }
So, like after a group of values $explode[filial]
Look what conclusion you need: $ explode [filial] contains an array of branches, then
Город1 Город1 Город1
Here below we summarize and display the same: Город1
Next:
Город2 Город2 Город2
Here below, we summarize and display the same: Город2
And so on.