* @package HTML_Progress */ require_once ('HTML/Progress.php'); $bar = new HTML_Progress(); $bar->setIncrement(5); $bar->setStringPainted(true); // get space for the string $bar->setString(''); // but don't paint it $ui =& $bar->getUI(); $ui->setStringAttributes('width=350 align=left'); ?> Horizontal String ProgressBar example

toHtml(); $pkg = array('PEAR', 'Archive_Tar', 'Config', 'HTML_QuickForm', 'HTML_CSS', 'HTML_Page', 'HTML_Template_Sigma', 'Log', 'MDB', 'PHPUnit'); do { $val = $bar->getValue(); $i = floor($val / 10); $msg = ($val == 100) ? '' : "  installing package ($val %) ... : ".$pkg[$i]; $bar->setString($msg); $bar->display(); if ($bar->getPercentComplete() == 1) { break; // the progress bar has reached 100% } $bar->incValue(); } while(1); ?>

<< Back examples TOC

print_r

toArray()); 
?>