- var_dump: documentation ( source)
- round: documentation ( source)
- define: documentation ( source)
<?php
define('PRIORITY_INQUIRER_OBJECT', 45);
define('PRIORITY_INQUIRER_QUESTION', 45);
$sum = 100;
$object = (int) (round(PRIORITY_INQUIRER_OBJECT / $sum, 1) * 100);
$question = (int) (round(PRIORITY_INQUIRER_QUESTION / $sum, 1) * 100);
$commercial = (int) (100 - ($question + $object));
var_dump($object, $question, $commercial);