php imap如何使用imap_sort获取过去7天的未读邮件?

Is it possible to get the unread messages of the last 7 days. ? I have

 $result = imap_sort($imap, SORTDATE, 1,"UNSEEN");

I found the answer:

$date = date ( "d M Y", strToTime ( "-7 days" ) );
$search_criteria = "SINCE \"$date\""." UNSEEN";

Try this,

$msg = imap_search( $imap, "SINCE Mon, 12 Jan 2015 0:00:00 UNSEEN")

and check below link also

Need Help on IMAP INBOX Search based on received date