Dethman Posted July 12, 2008 Share Posted July 12, 2008 Hey guys I am trying to get an if statment to this.... <?php if($var1*$var2 is 120% higher than of $var3*$var4){ do this } Is there a code for that if there is can someone help me out? Thank You, Brian Flores, CEO NimbusGames,llc Link to comment https://forums.phpfreaks.com/topic/114441-help-soon-please-wierd-if-statement/ Share on other sites More sharing options...
Jeigh Posted July 12, 2008 Share Posted July 12, 2008 <?php $var5 = $var3*$var4; $finalvar = $var5*1.20; $var = $var1*$var2; if($var == $finalvar) { //PHP CODE } and of course if you want 120% and greater just use > rather than ==. There is probably an easier way to do it than this and I'm not entirely sure that multiplying it by the decimal will work (3:30AM now anyway, my thinking is a little off). Link to comment https://forums.phpfreaks.com/topic/114441-help-soon-please-wierd-if-statement/#findComment-588471 Share on other sites More sharing options...
Dethman Posted July 12, 2008 Author Share Posted July 12, 2008 Yeah thanx I havnt slept in two days and I have to get this project done I seem to forget the smaller things when I havnt slept in along time :-\ Well thanx a million! Link to comment https://forums.phpfreaks.com/topic/114441-help-soon-please-wierd-if-statement/#findComment-588474 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.