Home  >  Article  >  Backend Development  >  PHP execution progress percentage code

PHP execution progress percentage code

PHP中文网
PHP中文网Original
2017-03-24 14:49:441862browse

PHP execution progress percentage code

 <?php
session_start();
$zs=21;//设置任务总数
if(!isset($_SESSION[&#39;num&#39;]))
$_SESSION[&#39;num&#39;]=$zs;//赋予session变量值
$jd=$_SESSION[&#39;num&#39;]--;//进度值
echo $jd;//显示进度值
echo "
";
echo 100-round($jd/$zs*100)."%";//显示完成进度百分比
?>

Related articles:

How to ensure that the sum of each part is 1 when calculating percentage in PHP

php fan-shaped percentage display program code

How to calculate the percentage of the progress bar displayed at the end of voting

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn