php how to perform imap_search and then sort only results

84 views Asked by At

How can I perform a imap_search an then sort the result by date ?

I've tried

$imap_ressource = imap_open($server, $user, $password)
$search = imap_search($imap_ressource, 'Subject blablabla'); // to search email with same subject
$sorted = imap_sort($search , SORTARRIVAL , 1); // ERROR : imap_sort wants $imap_ressource

So who can I search stuff and sort ONLY the result, not all emails ...

Thanks

0

There are 0 answers