<?php $oui = 10; $non = 5; $anno = 5; $total = 20; // pourcentages $prcentoui = round(($oui/$total)*100); $prcentnon = round(($non/$total)*100); $prcentanno = round(($anno/$total)*100); ?> Mon résultat de sondage Oui : <?php echo $prcentoui.'% ('.$oui.')'; ?> %;background:green;"> Non : <?php echo $prcentnon.'% ('.$non.')'; ?> %;background:red;"> Sans avis : <?php echo $prcentanno.'% ('.$anno.')'; ?> %;background:#CCCCCC;"> Total : <?php echo $total; ?> votant(s)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question