progress bar calculate percentage php

Solutions on MaxInterview for progress bar calculate percentage php by the best coders in the world

showing results for - "progress bar calculate percentage php"
Mayron
08 Feb 2019
1$playerson = (int)preg_replace( '/[^0-9]/', '', $data[4]);
2$maxplayers = (int)preg_replace( '/[^0-9]/', '', $data[5]);
3// $percentage = floor($playerson / $maxplayers) * 100; // floor (round down) optional
4// for echap to division by 0 add IF short form
5($maxplayers > 0) ?  $percentage = floor($playerson / $maxplayers) * 100 : 0; 
6