I am using `foreach` loop to assign values to an array.

```
$route_selection;
    foreach ($routes as $route) {
        $from_state = $route->fromState->name;
        $to_state = $route->toState->name;
        $from_country = $route->fromCountry->name;
        $to_country = $route->tocountry->name; 
        $route_selection[] = [$route->hash_id => 'From: '.$from_state.' ('.$from_country.') To: '.$to_state.' ('.$to_country.')'];
    }

```

Sure enough, it will have a result to something like this:
[![enter image description here](https://i.stack.imgur.com/LfuvR.jpg)](https://i.stack.imgur.com/LfuvR.jpg)

But I want the result to be something like this:
[![enter image description here](https://i.stack.imgur.com/hCLFZ.jpg)](https://i.stack.imgur.com/hCLFZ.jpg)

How can I possibly do that in PHP?