Codeigniter sort by date array
Hello yes you cant sort the arrays by date you need to use the function asort(if you want to do ascending sort), user arsort(if you want to do decending sort). here is the example that will make you understand.
$age = array("Peter"=>"2017-05-30", "Ben"=>"2017-01-31", "Joe"=>"2017-05-30");asort($age);foreach($age as $x => $x_value) { echo "Key=" . $x . ", Value=" . $x_value; echo "<br>";}