I have a function like this:
PHP Code:
public static function getAllUrls()
{
$db = JFactory::getDBO();
$db->setQuery("
SELECT * FROM #__mk_search_items
WHERE state = 1");
$urls = $db->loadAssocList();
$data = [];
foreach($urls as $url)
{
$data[] = ['label' => $url['name'], 'name' => $url['url'], 'target' => $url['target']];
}
return $data;
}
I need to sort the elements picked from the SELECT statement in alphabetically order before it is all put into the $data element.
I need help to do this, please.