All pastes #758029 Raw Edit

Untitled

public php v1 · immutable
·published 2007-11-01 20:59 UTC
rendered paste body
$tree = "";$name = "";function print_mailboxes($start = ""){	global $mbox;	global $tree,$name;		$list = imap_getmailboxes($mbox, "{localhost:143/novalidate-cert}$start", "%");		if (is_array($list)) {	    foreach ($list as $key => $val) {		  $space = "&nbsp;&nbsp;&nbsp;";		  $spaces = substr_count($start, ".");		  $spaces = str_repeat($space, $spaces);		  $name = str_replace("{localhost:143/novalidate-cert}$start", "", $val->name);		  $name = str_replace(".", "", $name);		   $tree .= $spaces.$name."<br>";			if (!($val->attributes & LATT_HASNOCHILDREN)) {				if(empty($start)){					$next = $start;				} else{					$next = $start . ".";				}				//print $next . $name . "<br>";				print_mailboxes($next . $name);			}	    }	}		return $tree;	}print print_mailboxes();