FOF30\Inflector\Inflector::getPart PHP Метод

getPart() публичный Метод

Use a negative index to start at the last part of the word (-1 is the last part)
public getPart ( string $string, integer $index, string $default = null ) : string
$string string Word
$index integer Index of the part
$default string Default value
Результат string
    public function getPart($string, $index, $default = null)
    {
        $parts = self::explode($string);
        if ($index < 0) {
            $index = count($parts) + $index;
        }
        return isset($parts[$index]) ? $parts[$index] : $default;
    }