您好,登錄后才能下訂單哦!
PHP中怎么設(shè)置進度條,針對這個問題,這篇文章詳細介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。
具體如下:
<html> <head> <style type="text/css"><!-- div { margin: 1px; height: 20px; padding: 1px; border: 1px solid #000; width: 275px; background: #fff; color: #000; float: left; clear: right; top: 38px; z-index: 9 } .percents { background: #FFF; border: 1px solid #CCC; margin: 1px; height: 20px; position:absolute; width:275px; z-index:10; left: 10px; top: 38px; text-align: center; } .blocks { background: #EEE; border: 1px solid #CCC; margin: 1px; height: 20px; width: 10px; position: absolute; z-index:11; left: 12px; top: 38px; filter: alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5; -khtml-opacity: .5 } --> </style> </head> <body> <?php if (ob_get_level() == 0) { ob_start(); } echo str_pad('Loading... ',4096)."<br />\n"; for ($i = 0; $i < 25; $i++) { $d = $d + 11; $m=$d+10; //This div will show loading percents echo '<div class="percents">' . $i*4 . '% complete</div>'; //This div will show progress bar echo '<div class="blocks" > </div>'; flush(); ob_flush(); sleep(1); } ob_end_flush(); ?> <div class="percents" >Done.</div> </body> </html>
關(guān)于PHP中怎么設(shè)置進度條問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注億速云行業(yè)資訊頻道了解更多相關(guān)知識。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。