how to get percentage of value in php ?i want to get percentage of value like i have 12345 total amount and 1200 amount is how much percentage of 12345 ?
$data1=12345; $dataofdata1=1200; $percent='';//want to find percentage
i trying following solution . but its not getting percentage
$percentInDecimal = $data1 / 100; //Get the result. $percent = $percentInDecimal * $dataofdata1; //Print it out - Result is 232. echo $percent;