📅  最后修改于: 2022-03-11 14:53:40.745000             🧑  作者: Mango
$beforeDot = array_shift(explode('.', $string));
$beforeDot = current(explode(".", $string));
// PHP <= 5.3:
$beforeDot = explode(".", $string);
$beforeDot = $beforeDot[0];