Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Roman Date

It calculates the date in Roman numbers.



<?php
$year = "1982";
$showreal = "no";
$roman_unit[0] = "";
$roman_unit[1] = "I";
$roman_unit[2] = "II";
$roman_unit[3] = "III";
$roman_unit[4] = "IV";
$roman_unit[5] = "V";
$roman_unit[6] = "VI";
$roman_unit[7] = "VII";
$roman_unit[8] = "VIII";
$roman_unit[9] = "IX";
$roman_tens[00] = "";
$roman_tens[10] = "X";
$roman_tens[20] = "XX";
$roman_tens[30] = "XXX";
$roman_tens[40] = "XL";
$roman_tens[50] = "L";
$roman_tens[60] = "LX";
$roman_tens[70] = "LXX";
$roman_tens[80] = "LXXX";
$roman_tens[90] = "XC";
$roman_hund[000] = "";
$roman_hund[100] = "C";
$roman_hund[200] = "CC";
$roman_hund[300] = "CCC";
$roman_hund[400] = "CD";
$roman_hund[500] = "D";
$roman_hund[600] = "DC";
$roman_hund[700] = "DCC";
$roman_hund[800] = "DCCC";
$roman_hund[900] = "CM";
$roman_thou[0000] = "";
$roman_thou[1000] = "M";
$roman_thou[2000] = "MM";
$roman_thou[3000] = "MMM";
$roman_thou[4000] = "MMMM";
$roman_thou[5000] = "MMMMM";
$timestamp = time();
$timestamp = $timestamp - 25220;
$date1 = date("m/d/y", $timestamp);
if(strlen(year) > 4 || strlen($year) < 4)
    {
        print("Variable <b>\$year</b> must be 4 characters. Please reconfigure script\n");
    } else {
    if ($showreal == "yes")
    {
        $real = " ($year)";
    } else {
        $real = "";
    }
    $thou = substr($year, -4, 1) * 1000;
    $hund = substr($year, -3, 1) * 100;
    $tens = substr($year, -2, 1) * 10;
    $unit = substr($year, -1, 1);
    echo "<!-- Generated with Andrew Heebner's Roman Numeral Generator ($date1) -->\n";
    echo "<pre>© " . "$roman_thou[$thou]" . "$roman_hund[$hund]" . "$roman_tens[$tens]" . "$roman_unit[$unit]" .     $real . "</pre>";
}
?>


Download code...


Print this page


 

Inizio pagina

risorse per webmaster