public function paragraphs_slice($text, $offset = 0, $length = null)
    {
        $result = array();
        preg_match_all('#<p[^>]*>(.*?)</p>#', $text, $result);

        // Null length = all the paragraphs
        if ($length === null) {
            $length = count($result[0]) - $offset;
        }

        return array_slice($result[0], $offset, $length);
    }