Numbers_Roman
[ class tree: Numbers_Roman ] [ index: Numbers_Roman ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <?php
  2. // Numbers Roman exaple 
  3. // $Id: Roman.php,v 1.14 2004/04/28 13:13:08 danielc Exp $
  4.  
  5. require_once("Numbers/Roman.php");
  6. $Num rand(1,3999)
  7. $NumHtml rand(500,5999999);
  8.  
  9. //converting a random number between 1 and 3999 from Arabic to the Roman Numeral
  10. //uppercase true, html false, then back to Arabic
  11. $key =  Numbers_Roman::toNumeral($Num,true,false);
  12. $NumKey Numbers_Roman::toNumber($key);
  13.  
  14.  
  15. // converting a random number between 500 and 5 999 999 to the Roman Numeral
  16. $RomeHtml     =  Numbers_Roman::toNumeral($NumHtml,true,true);       //uppercase true html true
  17. $RomenoHtml   =  Numbers_Roman::toNumeral($NumHtml,true,false);    //uppercase true html false
  18. $RomeHtmlnoLC =  Numbers_Roman::toNumeral($NumHtml,false,true);  //uppercase false html true
  19. $RomenoHtmlLC =  Numbers_Roman::toNumeral($NumHtml,false,false);  //uppercase false html false
  20.  
  21. $toArabic Numbers_Roman::toNumber($RomenoHtml)//back to the Arabic number 
  22.  
  23. echo "Random: ".$Num." (To roman) -> ".$key." (Back to arabic) -> ".$NumKey." <BR> <BR>";
  24.  
  25. echo "Random with HTML enabled converting ".$NumHtml." into a Roman Numeral ".$RomeHtml."<BR>";
  26. echo "Lowercase html $RomeHtmlnoLC.. <BR> ".$RomenoHtml." uppercase no html <BR> 
  27. $RomenoHtmlLC lowercase no html <BR>and back to Arabic ".$toArabic."";
  28.  
  29.  
  30.  
  31. ?>

Documentation generated on Mon, 11 Mar 2019 10:16:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.