- strpos: documentation ( source)
- explode: documentation ( source)
<?php
$number = 10000.00;
if (strpos((string)$number, '.') !== false) {
list($number, $fraction) = explode('.', $number);
if(empty($fraction)){
$fraction = "00";
}
}
echo $fraction;
?>