PHP code example of joaoreisweb / numbers-in-roman

1. Go to this page and download the library: Download joaoreisweb/numbers-in-roman library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

joaoreisweb / numbers-in-roman example snippets




oaoreisweb\NumbersInRoman;

$number_convert = new NumbersInRoman();

$number = 1500;
echo '<br>'.$number.' - '.$number_convert->convertIntToRoman($number);

$number = 1600;
echo '<br>'.$number.' - '.$number_convert->convertIntToRoman($number);

$number = 1000;
echo '<br>'.$number.' - '.$number_convert->convertIntToRoman($number);

$number = 1550;
echo '<br>'.$number.' - '.$number_convert->convertIntToRoman($number);

$roman = 'MMXXI';
echo '<br>'.$roman.' - '.$number_convert->convertRomanToInt($roman);

$roman = 'MCDDXIV';
echo '<br>'.$roman.' - '.$number_convert->convertRomanToInt($roman);