I have an array populated dynamically from customers data in a foreach loop. It looks like this : "Émilie Champagne" => "array",
$customers = get_customers_from_orders( $customers_orders ); // Get an array of customers data
if ( $customers !== 'empty' ) {
$customers_items = array();
foreach ( $customers as $customer ) {
$html = '';
// THE CUSTOM LIST ITEM
$html .= '<li order_id="'.$customer['order_id'].'" email="'.$customer['email'].'">';
$html .= $customer['name'];
$html .= '</li>';
$customers_items[$customer['name']] = $html;
}
ksort( $customers_items );
foreach ( $customers_items as $customer_item ) {
$customer_list .= $customer_item;
}
}
When i use the ksort, its working but only one customer at the end is not sorted correctly.
You can see the last item is starting with letter "E".
The same thing happens on 3 others ksort function on the same page.
Any idea how i could fix this?