Imap_mail_move: move 10 messages

Using PHP’s IMAP functions, I want to move 10 messages from the folder “xyz_msg” to the folder “xyz_tmp”

Below is the code I use to connect to the email server.


<?php 
 
$mbox = imap_open ("{imap.gmail.com:993/imap/ssl/novalidate-cert}xyz_tmp", "example@gmail.com", "password") 
     or die("can't connect: " . imap_last_error());  
 
$imap_obj = imap_check($mbox); 
echo "<pre>"; 
var_dump($imap_obj); 
echo "</pre>"; 
 
$check = imap_mailboxmsginfo($mbox); 
 
if ($check) { 
    echo "Date: "     . $check->Date    . "<br />\
" ; 
    echo "Driver: "   . $check->Driver  . "<br />\
" ; 
    echo "Mailbox: "  . $check->Mailbox . "<br />\
" ; 
    echo "Messages: " . $check->Nmsgs   . "<br />\
" ; 
    echo "Recent: "   . $check->Recent  . "<br />\
" ; 
    echo "Unread: "   . $check->Unread  . "<br />\
" ; 
    echo "Deleted: "  . $check->Deleted . "<br />\
" ; 
    echo "Size: "     . $check->Size    . "<br />\
" ; 
} else { 
    echo "imap_check() failed: " . imap_last_error() . "<br />\
"; 
} 
 
imap_close($mbox); 
 
?>