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

[ad_1]

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

[ad_2]

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