PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Christoph Kappestein   Roman   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: Roman
Convert between roman and decimal representation
Author: By
Last change:
Date: 14 years ago
Size: 317 bytes
 

Contents

Class file image Download
<?php

header
('Content-type: text/plain');

include_once(
'roman.php');

try
{
   
$roman = new roman();

    for(
$i = 1; $i <= 10; $i++)
    {
       
$r = $roman->encode($i);
       
$d = $roman->decode($r);

        echo
$i . ' : ' . $r . ' = ' . $d . "\n";
    }

}
catch(
Exception $e)
{
    echo
'something goes wrong';
}