public function last(array $elements, $amount = 1)
    {
        $elements = array_slice($elements, count($elements) - $amount);

        return count($elements) == 1 ? reset($elements) : $elements;
    }
public function last(array $elements, $amount = 1)
    {
        $elements = array_slice($elements, count($elements) - $amount);

        return count($elements) == 1 ? reset($elements) : $elements;
    }
public function last ( array $ elements , $ amount = 1 ) { $ elements = array_slice ( $ elements , count ( $ elements ) - $ amount ) ; return count ( $ elements ) == 1 ? reset ( $ elements ) : $ elements ; }
Get the last n elements.

@param array $elements
@param integer $amount
@return mixed|array
Get the last n elements .