I have weird problem with wrapping anchor tag around div in php because anchor goes inside div. Here is code:

```
$output .= '<a href="http://google.com">';
$maplist = implode(', ', array_values($rounds));
$output .= '<div class="maplist">' . $maplist . '</div>';
$output .= '</a>';

echo $output;

```

Html shows like this 

```
 <div class="maplist"><a href="http://google.com"></a>
   <a title="cs_assault" href="link1">cs_assault</a>, 
   <a title="de_aztec" href="link2">de_aztec</a>
   </div>

```

instead of

```
<a href="http://google.com">
   <div class="maplist">
   <a title="cs_assault" href="link1">cs_assault</a>, 
   <a title="de_aztec" href="link2">de_aztec</a>
   </div></a>

```

Weird part is when I remove implode function it outputs like it should.