(PHP 4, PHP 5, PHP 7)
imap_listscan — Returns the list of mailboxes that matches the given text
$imap_stream
   , string $ref
   , string $pattern
   , string $content
   )
   Returns an array containing the names of the mailboxes that have
   content in the text of the mailbox.
  
   This function is similar to imap_listmailbox(),
   but it will additionally check for the presence of the string
   content inside the mailbox data.
  
 imap_streamUm stream IMAP retornado por imap_open().
ref
       ref should normally be just the server 
       specification as described in imap_open()
      
patternEspecifica aonde na hierarquia da caixa de mensagens deve começar a procura.
Existem dois caracteres especiais que você
 pode passar como parte para o pattern:
 '*' e '%'.
 '*' significa retornar todas as caixas de mensagens. Se você passar
 pattern como '*', você terá
 uma lista de toda a hierarquia da caixa de mensagens.
 '%'
 significa retornar o nível atual apenas.
 '%' como o parâmetro pattern
 ira retornar apenas as caixar de mensagem do nível superior;
 '~/mail/%' em UW_IMAPD irá retornar cada caixa de mensagem no diretório ~/mail, mais nenhuma em subpastas deste diretório.
contentThe searched string
   Returns an array containing the names of the mailboxes that have
   content in the text of the mailbox.