I have this array in PHP:
foreach($rss_items as $item) :
$contenu[] = array (
"auteur" => $author,
"date" => $item->get_date(),
"contenu" => $item->get_content()
);
At the end, my array is composed of 6 parts, which everyone contains the 3 variable above.
My question is: How can I sort the array by date and using the strtotime because it’s easier to sort with this function.
strtotime($item->get_date());
Use
usortto sort based on your own callback function.NOTE: This will only work in PHP 5.3+. If you have 5.2 or lower, you can use
create_function.