explode first occurrence php code example
Example: php explode and get first value
$beforeDot = array_shift(explode('.', $string));
$beforeDot = current(explode(".", $string));
// PHP <= 5.3:
$beforeDot = explode(".", $string);
$beforeDot = $beforeDot[0];