<?php
$number = "123.00";
echo ($number == (int) $number) ? (int) $number : $number, PHP_EOL;
// 123
$number = "123.10";
echo ($number == (int) $number) ? (int) $number : $number, PHP_EOL;
// 123.10
$number = "123.1000";
echo ($number == (int) $number) ? (int) $number : $number, PHP_EOL;
// 123.1000
PD9waHAKCiRudW1iZXIgPSAiMTIzLjAwIjsKZWNobyAoJG51bWJlciA9PSAoaW50KSAkbnVtYmVyKSA/IChpbnQpICRudW1iZXIgOiAkbnVtYmVyLCBQSFBfRU9MOwovLyAxMjMKCiRudW1iZXIgPSAiMTIzLjEwIjsKZWNobyAoJG51bWJlciA9PSAoaW50KSAkbnVtYmVyKSA/IChpbnQpICRudW1iZXIgOiAkbnVtYmVyLCBQSFBfRU9MOwovLyAxMjMuMTAKCiRudW1iZXIgPSAiMTIzLjEwMDAiOwplY2hvICgkbnVtYmVyID09IChpbnQpICRudW1iZXIpID8gKGludCkgJG51bWJlciA6ICRudW1iZXIsIFBIUF9FT0w7Ci8vIDEyMy4xMDAw