here is some working code, there are only 2 changes, one is the object names were wrong, and 2, the imap_status had the wrong thing in the 2nd parameter.
<?php
$mbox = imap_open("{drew-phillips.com/imap}", "username", "pass", OP_HALFOPEN) or die("Imap Error: " . imap_last_error());
$boxes = imap_list($mbox, "{drew-phillips.com}", "*");
if (!$boxes) {
die("no boxes listed");
}
foreach($boxes as $box) {
$status = imap_status($mbox, $box, SA_ALL);
echo "<b>Mailbox $box</b><br />\n";
echo "- " . $status->messages . " messages<br />\n";
echo "- " . $status->unseen . " new messages<br />\n";
echo "<br />\n\n";
}
imap_close($mbox);
?>
www.drew-phillips.com/php/test.php