monkeybidz Posted March 14, 2007 Share Posted March 14, 2007 I have a variable: $price $price = "100.00"; I need to get 50% of 100.00 when another variable value = Yes: if($discount = 'Yes') When it is = to Yes, i need $price to = $price - 50% discount. Can anyone help? I have had this same question answered before, but cannot seem to find some of my post recently. Link to comment https://forums.phpfreaks.com/topic/42753-convert-an-amount-to-a-discounted/ Share on other sites More sharing options...
per1os Posted March 14, 2007 Share Posted March 14, 2007 <?php if (strtolower($discount) == "yes") { $discountPrice =($price \ .5); $newPrice = $price - $discountPrice; } ?> --FrosT Link to comment https://forums.phpfreaks.com/topic/42753-convert-an-amount-to-a-discounted/#findComment-207464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.