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);
    }
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);
    }
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 ) ; }
Extracts paragraphs from a string.

This function uses array_slice(). The function signatures are similar.

@see     http://www.php.net/manual/en/function.array-slice.php

@param   string      $text       String containing paragraphs.
@param   integer     $offset     Number of paragraphs to offset. Default: 0.
@param   integer     $length     Number of paragraphs to extract. Default: null.
@return  string[]
Extracts paragraphs from a string .