I'm playing with the imap_getmailboxes() function, and it's working great!
This is what I coded:
<?php
// list all mailboxes
$boxes = imap_getmailboxes($imap, "{localhost}", "*");
foreach($boxes as $val) {
$name = $val->name;
?>
<table><tr><td><? echo $name; ?></td></tr></table>
<? } ?>
And this is what is returned:
{localhost}FOLDER 1
{localhost}FOLDER 2
{localhost}FOLDER 3
{localhost}INBOX
{localhost}Sent Items
I want to get rid of the {localhost} part, but it seems to be a part of the array. I played with the explode() function and it worked. But now I'm wondering, is there a way to NOT show any results from an array?
I want to not show INBOX, Sent Items, Trash, and a few others. I plan to put those at the top, while I wish to alphabetize the rest.
Does the foreach() have a way to do that?
Any thoughts?