PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Ian Lord   Number to word   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Usage demonstration
Class: Number to word
Spell numbers in French and English and others
Author: By
Last change: Added German Language
Date: 17 years ago
Size: 1,159 bytes
 

Contents

Class file image Download
<html>
<head></head>
<body>
<table cellpadding="0" cellspacing="0" border="1">
<tr>
    <th>Number</th>
    <th>In French</th>
    <th>In English</th>
    <th>In German</th>
</tr>
<?php
   
require_once ('/usr/local/www/dev.immo.ezmax.ca/pub/class/class.numbertoword.cmd');
   
$iNumber = 999999999999999;
    echo
'<tr><td>'.str_pad($iNumber,15,'0',STR_PAD_LEFT).'</td><td>'.CLASS_Numbertoword::convert($iNumber,'fr').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'en').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'de').'</td></tr>';
    for (
$x=0;$x<1000;$x++){
       
$iNumber = $x;
        echo
'<tr><td>'.str_pad($iNumber,15,'0',STR_PAD_LEFT).'</td><td>'.CLASS_Numbertoword::convert($iNumber,'fr').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'en').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'de').'</td></tr>';
    }
    for (
$x=0;$x<100;$x++){
       
$iNumber = mt_rand(0,mt_getrandmax());
        echo
'<tr><td>'.str_pad($iNumber,15,'0',STR_PAD_LEFT).'</td><td>'.CLASS_Numbertoword::convert($iNumber,'fr').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'en').'</td><td>'.CLASS_Numbertoword::convert($iNumber,'de').'</td></tr>';
    }
?>
</table>
</body>
</html>