Here’s my code.
<p>You worked <?php echo $hours ?>hour(s) this week.</p>
<p>Your pay for the week is: <?php $wage = $_GET["wage"] * ($hours > 40 ? $hours * 1.5 : $hours);
;echo number_format("$wage",2); ?></p>
Thing about this is it calculated by 1.5 if it works over 40+ ..
But i want it like this.
Lets say you work 41 hours.
I want 40 hours to be the standard rate
and the 1 hour is multiply by 1.5
How can i do that?
Exactly like you have written in your question (not in your code):
or, condensed: