View Single Post

  #1 (permalink)  
Old 09-04-2004
StinkFinger
 
Posts: n/a
Default Adding discount script...

All,
I have been working on a small script that will detect the day of the month,
and apply that percent off of an item. For example, on the 3rd, 3% off,
12th, 12% off, etc.

This is what I have so far, does it look correct ?

$t = (intval(date("j")) / 10);
$p = explode(".", $price); // $price is returned from the db in this format
10.00
$np = number_format($p[0] - $t, 2);

Any improvements ?
Thanks.


Reply With Quote