Location: PHPKode > scripts > Cifra > cifra/index.php
<?php

require_once( 'cifra.php' );

$cifra = new cifra();

$romanINPUT = "MCMLXXIV" ;

echo "The input in roman digits is : <b>$romanINPUT</b><br/>" ;
$arabicOUTPUT = $cifra->to_arabic( $romanINPUT );
echo "The output in arabic digits is : <b>$arabicOUTPUT</b><br/><br/>" ;

$binaryINPUT = "11111101" ;

$f = $cifra->format_number( $binaryINPUT, 2 ) ;
echo "The input in binary digits is : <b>$f</b><br/>" ;
$decimalOUTPUT = $cifra->to_decimal( $binaryINPUT, 2 );
$f = $cifra->format_number( $decimalOUTPUT, 10 ) ;
echo "The input in decimal digits is : <b>$f</b><br/><br/>" ;

echo "The member functions of this class might be also used in<br/>";
echo "combined mode: for example ...<br/><br/>";

$octalINPUT = "543" ;

$f = $cifra->format_number( $octalINPUT, 8 ) ;
echo "The input in octal digits is : <b>$f</b><br/>" ;
$decimalOUTPUT = $cifra->to_decimal( $octalINPUT, 8 );
$f = $cifra->format_number( $decimalOUTPUT, 10 ) ;
echo "[INTERMEDIATE] The input in decimal digits is : <b>$f</b><br/>" ;
$hexOUTPUT = $cifra->to_base( $decimalOUTPUT, 16 );
$f = $cifra->format_number( $hexOUTPUT, 16 ) ;
echo "The output in hex digits is : <b>$f</b><br/>" ;


?>
Return current item: Cifra