src/includes/classes/Core/Utils/Name.php
public function firstIn(string $name, string $email = ''): string
    {
        $name = $this->stripClean($name);

        if ($name && mb_strpos($name, ' ', 1) !== false) {
            return explode(' ', $name, 2)[0];
        } elseif (!$name && $email && mb_strpos($email, '@', 1) !== false) {
            return $this->c::mbUcFirst(explode('@', $email, 2)[0]);
        } else {
            return $name;
        }
    }
public function firstIn(string $name, string $email = ''): string
    {
        $name = $this->stripClean($name);

        if ($name && mb_strpos($name, ' ', 1) !== false) {
            return explode(' ', $name, 2)[0];
        } elseif (!$name && $email && mb_strpos($email, '@', 1) !== false) {
            return $this->c::mbUcFirst(explode('@', $email, 2)[0]);
        } else {
            return $name;
        }
    }
First from full name.

@since 151121 Adding name utilities.

@param string $name  Full name.
@param string $email Fallback on email?

@return string First name.