Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Roman Numeral Date Generator

Code Wizard, 12-30-2006

Generates defined year in roman numerals (Updated 10/25/00)

<?php

//
// ---------------------------------------------------
// 2000 Andrew Heebner / EvilWalrus.com
// No unauthorized copying and or solicitation
// ---------------------------------------------------
// Date : 07/28/00 Email : andrew@evilwalrus.com
// ---------------------------------------------------
//

//
// change the user variables as you need below
//
$year = "1982"; // date to be converted to roman numerals
$showreal = "no"; // show real date next to roman numerals (yes or no)

//
// begin roman numerical legend
//
$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
");
} else {
if ($showreal == "yes")
{
$real = " ($year)";
} else {
$real = "";
}
//
// compute arrays
//
$thou = substr($year, -4, 1) * 1000;
$hund = substr($year, -3, 1) * 100;
$tens = substr($year, -2, 1) * 10;
$unit = substr($year, -1, 1);
//
// print output in roman numerals
//
echo "<!-- Generated with Andrew Heebner's Roman Numeral Generator ($date1) -->
";
echo "<pre> " . "$roman_thou[$thou]" . "$roman_hund[$hund]" . "$roman_tens[$tens]" . "$roman_unit[$unit]" . $real . "</pre>";
}

?>

Branden Age:9, 11-20-2008
IDIOT LEARN HOW TO DO ROMAN NUMERALS

l=1
V=5
X=10
L=50
C=100
CC=200
CCC=300
CD=400
D=500
DC=600
DCC=700
DCCC=800
CM=900
M=1,000
MM=2,000
MMM=3,000
MV=4,000
V WITH LINE ABOVE= 5,000
X WTH LINE ABOVE=10,000
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions