Periodische Zahlen in Php?

  • Hallo Community!

    Ich habe vor etwa zwei Monaten mit php angefangen und bin grad bei einem (kleinen) Problem.
    Ist es möglich in php eine Periodische Zahl wiederzugeben? (z.B. 60/18=3.333333....(usw.)
    Danke im Vorraus :D

    Kaili

  • PHP
    <?php
       $a = 60;
       $b = 18;
       $c = $a / $b;
    
       echo $c . "
    " . bcdiv(60, 18, 20);
    ?>