PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Ming Choi   Smooth Decrease Class   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Smooth Decrease Class
Generate a series of values that decrease smoothly
Author: By
Last change:
Date: 14 years ago
Size: 506 bytes
 

Contents

Class file image Download
<?php
// Smooth Decrease Class Example
require "sd.php";

$sd = new SmoothDecrease(200, 500, 0);
//value start from 200, decrese to 0 after 500 steps, round to interger

while($sd->checkRemain()){//check if steps remaining
   
$sd->skip(2); //skip 2 steps(example only, not necessary)
   
echo "<img src='' height='".$sd->getValue()."' width='2' />";
   
//read one value, and go to the next step, show by invaild images
}

$sd->clear(); //set the step to the begining (example only, not necessary)
?>