title: How would I move a message from Gmail Inbox to a label?
body: <p>I'm trying to move messages away from Inbox into Processed label with this code:</p>
  
  <pre><code>$inbox = imap_open($host,$user,$pass) or die('Error: ' . imap_last_error());
  
  if( $emails = imap_search($inbox,'ALL') )
  {
      foreach($emails as $email_number) {
          imap_mail_move($inbox, $email_number, 'Processed') or die('Error');
      }
  
  }
  imap_expunge($inbox);
  imap_close($inbox);
  </code></pre>
  
  <p>Unfortunately, while the messages get the Processed label, they're still left in Inbox too.</p>
  
  <p>How would I make them go away from Inbox?</p>