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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.