Answer the question
In order to leave comments, you need to log in
How to make ksort work with a 2D array?
If I make an array like this:
$mysites[$sitedetails->blogname]['blog_id'] = $sitel['blog_id'];
$mysites[$sitedetails->blogname]['url'] = 'http://'.$sitel['domain'].$sitel['path'];
$mysites[$sitedetails->blogname]['blogname'] = $sitedetails->blogname;
ksort($mysites);//сортируем по ключу
$bycountry[$country][$sitedetails->blogname]['blog_id'] = $sitel['blog_id'];
$bycountry[$country][$sitedetails->blogname]['url'] = 'http://'.$sitel['domain'].$sitel['path'];
$bycountry[$country][$sitedetails->blogname]['blogname'] = $sitedetails->blogname;
foreach ($bycountry as $country) {
ksort($country);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question