Jump to content

[SOLVED] Checking %'s


SirChick

Recommended Posts

i don't think theirs a buildin one.. kinda simple to do so, i wouldn't see the point!

 

<?php
$vara = 10;
$varb = 200;
$per =  10;

$check = (($vara/$varb)*100);
if($check < $per){echo  "Less than $per%";}
if($check > $per){echo  "More than $per%";}
if($check == $per){echo  "Equal than $per%";}

?>

Link to comment
https://forums.phpfreaks.com/topic/77824-solved-checking-s/#findComment-393896
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.