iandevlin.com

Icon

A mixture of musings on web design & development, history, and life

Decimal to Roman Numeral converter ported to PHP

decimal to roman numerals

Back in March I created a decimal to roman numerals converter in JavaScript. Well I’ve now ported it to PHP, which you can download to use freely.

This version works for PHP 5+, so you will need to make some changes for it to work on PHP 4, or if demand requires it, I will do it myself and post it here.

It’s very simple to use, all you need to do is include the roman.numerals.php class file, declare an instance of the class, and convert your required number:

<?php
  require("roman.numerals.php");
  
  $r2d = new DecimalToRoman();
  $r2d->convert(2010);
        echo $r2d->roman;
?>

Any thoughts or comments, please let me know!

http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/digg_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/reddit_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/delicious_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/technorati_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/google_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/facebook_24.png http://www.iandevlin.com/blog/wp-content/plugins/sociofluid/images/twitter_24.png

Related posts:

  1. Converting decimal numbers to Roman numerals in JavaScript
  2. This blog is now HTML5 compliant
  3. Adding multiple .NET User Controls that use JavaScript to the same page

4 Responses

  1. stv says:

    Bookmarked!

  2. [...] Decimal to Roman Numeral converter ported to PHP – iandevlin.com … [...]

  3. Gadget Newz says:

    [...] Decimal to Roman Numeral converter ported to PHP [...]

  4. [...] This post was mentioned on Twitter by Ian Devlin, Ian Devlin. Ian Devlin said: [new blog post] I've just converted my decimal to roman numerals converter to #PHP and it's available for download http://bit.ly/cx8FmS [...]

Leave a Reply