Search
 
SCRIPT & CODE EXAMPLE
 

PHP

get romawi number php

/**
 * @param int $number
 * @return string
 */
function numberToRomanRepresentation($number) {
    $map = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40, 'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
    $returnValue = '';
    while ($number > 0) {
        foreach ($map as $roman => $int) {
            if($number >= $int) {
                $number -= $int;
                $returnValue .= $roman;
                break;
            }
        }
    }
    return $returnValue;
}
Comment

PREVIOUS NEXT
Code Example
Php :: sha256 php cantidad caracteres 
Php :: naming convention for magento2 custom cms page index xml file 
Php :: laravel admin multi images 
Php :: specify php version composer 
Php :: how to rename a table element in laravel 
Php :: how to fetch all user data form user in wp 
Php :: yii2 sendemail extension 
Php :: joomla print query 
Php :: select randomly from mysqli php 
Php :: explode (PHP 4, PHP 5, PHP 7, PHP 8) explode — Split a string by a string 
Php :: php if in database field exists, if exists update, if not create 
Php :: get url parameter laravel 5.2 constructor 
Php :: php after leave page 
Php :: Skip model accessor laravel8 
Php :: laravel pagination get items array 
Php :: how to remove third brackets from encoded json array in php 
Php :: remove jquery wp 
Php :: wordpress get the short permalink 
Php :: symfony auto decode json request 
Php :: Before Action methoond in Yii 1 controller 
Php :: php user ip from post request 
Php :: wordpress convert object to array 
Php :: blade directive 
Php :: php array remove empty values recursive 
Php :: how does substr_compare() works PHP 
Php :: Laravel unique with Validation rule 
Php :: where to add browscap php 
Php :: json_decode php multidimensional array 
Php :: Cannot modify header information - headers already sent by 
Php :: php if null then 0 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =