Numbers to Roman Numbers with php

前端 未结 6 1824
[愿得一人]
[愿得一人] 2020-12-24 14:11

I need to transform ordinary numbers to Roman numerals with php and I have this code:

        

        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 14:43

    There is an illegal offset issue.

    Replace

    $o=1:$b].$s);
    

    with

    $o=1:$b >0 ? $b : 0].$s);
    

提交回复
热议问题