Location: PHPKode > scripts > Dec2RomanNumConverter > demo.php
<html>
	<body>
<?php
include_once('Dec2RomanNumConverter.php');

$d2rnc = new Dec2RomanNumConverter();
$rnArray = array(); //Array that we'll be used in second example.

//Decimal 2 Roman numerals example.
try {
	for ($i = 1; $i <= 100; $i++) {
		echo $i . ' = ' . $d2rnc->dec2roman($i) . '<br />';
		$rnArray[] = $d2rnc->dec2roman($i);
	}
}
catch (Exception $ex) {
	echo $ex->getMessage();
}

//Roman 2 decimal numbers example.
$marker = 0;
foreach ($rnArray as $rn) {
	if ($marker == 0) {
		echo '<br />' . $d2rnc->roman2dec($rn);
		$marker = 1;
	}
	else {
		echo ', ' . $d2rnc->roman2dec($rn);
	}
}
?>
	</body>
</html>
Return current item: Dec2RomanNumConverter