[Solved] How to sort multidimensional PHP array (recent news time based implementation)


First convert your JSON string to PHP array using json_decode.

Use usort to sort the array like.

usort($array, 'sortByDate');

function sortByDate($a, $b) {
    $date1=$a['pubDate'];
    $date2=$b['pubDate'];

   //return value based on above two dates.
}

1

solved How to sort multidimensional PHP array (recent news time based implementation)