title: Check if folder exists with IMAP
body: <p>I have a script which processes emails and moves them to another folder. It works fine at the moment, but I want to be able to test if the folder I want to move the emails to exists first before I execute <code>imap_mail_move()</code>. Is there a quick way of doing this?</p>
  
  <pre><code>$hostname="{".$imap_details['imap_server']."}INBOX".$imap_details['imap_path'];
  $imap = imap_open($hostname, $imap_details['email'], $imap_details['imap_password']);
  $processed_folder="INBOX/Processed";
  //*** I would like to check if the above folder exists here ****
  //And then do some processing here
  //And then move the email to the processed folder
  imap_mail_move($imap,$i,$processed_folder);
  </code></pre>