PHP execution progress percentage code
<?php session_start(); $zs=21;//设置任务总数 if(!isset($_SESSION['num'])) $_SESSION['num']=$zs;//赋予session变量值 $jd=$_SESSION['num']--;//进度值 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