Question: I have tried several ways to close the dropdown but I cannot figure it out. 

```
<div class="collapse navbar-collapse" id="navbar-collapse">
    <ul class="nav navbar-nav">
        <li class="dropdown"><a href="#" data-toggle="dropdown" class="dropdown-toggle">Dropdown<span class="caret"></span></a>
            <ul class="dropdown-menu" role='menu'>
                <li><a href="#section1">section1</a></li>
                <li><a href="#section2">section2</a></li>
                <li><a href="#section3">section3</a></li>
            </ul>
        </li>
    </ul>
</div>

```

css: 

```
.dropdown:hover .dropdown-menu {
display: block;
}

```

Answer: 
Try this code 

```
$test = array(
(int) 0 => array(
    'Size' => array(
        'id' => '12',
        'name' => 'Mini'
    ),
    'Price' => array(
        'price' => '4.35'
    )
),
(int) 1 => array(
    'Size' => array(
        'id' => '13',
        'name' => 'Medium'
    ),
    'Price' => array(
        'price' => '6.15'
    )
),
(int) 2 => array(
    'Size' => array(
        'id' => '15',
        'name' => 'Maxi'
    ),
    'Price' => array(
        'price' => '11.75'
    )
)
);
$result = array();
$i=0;
foreach ($test as $temp){

$result[$i] = array(
        'id' => $temp['Size']['id'],
        'name' => $temp['Size']['name'],
        'price' => $temp['Price']['price']
    );

$i++;
}
echo "<pre/>";
print_r($result);

```
`$result = array_map($source_array, function ($item){ return array_flatten($item); });`