cvs: pear /Math_Numbers/docs/examples example.php
| From: | David Costa | Date: | Wed, 28 Apr 2004 20:21:17 +0000 |
| Subject: | cvs: pear /Math_Numbers/docs/examples example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-18911@lists.php.net to get a copy of this message | ||
gurugeek Wed Apr 28 16:21:17 2004 EDT
Added files:
/pear/Math_Numbers/docs/examples example.php
Log:
example added
http://cvs.php.net/co.php/pear/Math_Numbers/docs/examples/example.php?r=1.1&p=1
Index: pear/Math_Numbers/docs/examples/example.php
+++ pear/Math_Numbers/docs/examples/example.php
<?php
// Numbers Roman example
require_once("Numbers/Roman.php");
$Num = rand(1,3999);
$NumHtml = rand(500,5999999);
//converting a random number between 1 and 3999 from Arabic to the Roman Numeral
//uppercase true, html false, then back to Arabic
$key = Numbers_Roman::toNumeral($Num,true,false);
$NumKey = Numbers_Roman::toNumber($key);
// converting a random number between 500 and 5 999 999 to the Roman Numeral
$RomeHtml = Numbers_Roman::toNumeral($NumHtml,true,true); //uppercase true html true
$RomenoHtml = Numbers_Roman::toNumeral($NumHtml,true,false); //uppercase true html false
$RomeHtmlnoLC = Numbers_Roman::toNumeral($NumHtml,false,true); //uppercase false html true
$RomenoHtmlLC = Numbers_Roman::toNumeral($NumHtml,false,false); //uppercase false html false
$toArabic = Numbers_Roman::toNumber($RomenoHtml); //back to the Arabic number
echo "Random: ".$Num." (To roman) -> ".$key." (Back to arabic) ->
".$NumKey." <BR> <BR>";
echo "Random with HTML enabled converting ".$NumHtml." into a Roman Numeral
".$RomeHtml."<BR>";
echo "Lowercase html $RomeHtmlnoLC.. <BR> ".$RomenoHtml." uppercase no html
<BR>
$RomenoHtmlLC lowercase no html <BR>and back to Arabic ".$toArabic."";
?>