In my code below I would like to sort the array $v by its key title, which has only numeric values.
foreach ($archive_years as $key => $value) {
$id = str_replace(' ', '', $key);
echo '
<button type="button" class="btn btn-info collapsible" data-toggle="collapse" data-target="#archiv_'. $id .'"><h3>'. $key .' </h3></button>
<div id="archiv_'. $id .'" class="collapse">
<ul>
';
foreach ($value as $k => $v) {
ksort($v);
var_dump($v);
if (get_page($v['id'])->post_content) {
echo '<li><h4><a href="'. $v["permalink"] .'">'. $v["title"] .' - '. $v["titel"] .'</a></h4></li>';
}
else {
echo '<li><h4>'. $v["title"] .' - '. $v["titel"] .'</h4></li>';
}
}
echo '</ul></div>';
}
I have tried using ksort($v); but that seems not to work in this case.
This is what echo "<pre/>";print_r($v); returns:

Any help would be appreciated!
$v? show us for one by doingecho "<pre/>";print_r($v);