3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = '105,15'; $part = 0; function decimalPart($price) { $price = str_replace(',', '.', $price); $price = round($price, 2); return round($price - (int)$price, 2); } var_dump(decimalPart($price));

preferences:
53.99 ms | 402 KiB | 5 Q