您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

关于PHP 进度条函数的简单实例

2024/2/24 9:09:20发布14次查看
本文主要介绍了php 进度条函数的简单实例的相关资料,希望通过本文能帮助到大家,需要的朋友可以参考下,希望能帮助到大家。
php 进度条函数的简单实例
其实进度条的做法很简单的。网上的一大堆,自己写了一个,哈哈,感觉看起来很有感觉。
实例代码:
function showpercent($now,$total) { $percent = sprintf('%.0f',$now*100/$total); $html = '<table width="60%" style="border-collapse:separate" height="10" border="0" cellpadding="0" cellspacing="2" bgcolor="#fff"><tr>'; $count=0; $pertr = 30; while($count < $total) { $bgcolor = $count < $now ? 'green':'#eeeeee'; $html .= '<td bgcolor="'.$bgcolor.'"> </td>'; $count++; if($count%$pertr == 0) $html .= '</tr><tr>'; } $bgcolor2 = $now == $total ? ' style="font-weight:bold;color:green;"':''; $html .= '<td'.$bgcolor2.' colspan="'.($count%$pertr).'">'.$percent.'%</td></tr></table>'; return $html; }
效果截图: 100%的时候。
相关推荐:
jquery网页加载进度条实现方法
html5 ajax文件上传进度条如何显示
ajax 实现加载进度条的方法
以上就是关于php 进度条函数的简单实例的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product