title: Modify function to include paragraphs
body: <p>I have this excerpt function that cuts the content after the first paragraph (after the first <code>&lt;/p&gt;</code> tag. </p>
  
  <p>I need to modify this so I can cut the content after the second or third paragraph, that is the second or third <code>&lt;/p&gt;</code> tag. My knowledge of php is not great, so any help will be appreciated. </p>
  
  <p>Here is my function</p>
  
  <pre><code>if ( ! function_exists( 'wpse0001_custom_wp_trim_excerpt' ) ) : 
  
  function wpse0001_custom_wp_trim_excerpt($wpse0001_excerpt) {
  global $post;
  $raw_excerpt = $wpse0001_excerpt;
  if ( '' == $wpse0001_excerpt ) {
  
  $wpse0001_excerpt = get_the_content('');
  $wpse0001_excerpt = strip_shortcodes( $wpse0001_excerpt );
  $wpse0001_excerpt = apply_filters('the_content', $wpse0001_excerpt);
  $wpse0001_excerpt = substr( $wpse0001_excerpt, 0, strpos( $wpse0001_excerpt, '&lt;/p&gt;' ) + 4 );
  $wpse0001_excerpt = str_replace(']]&gt;', ']]&amp;gt;', $wpse0001_excerpt);
  
  $excerpt_end = ' &lt;a href="'. esc_url( get_permalink() ) . '"&gt;' . '&amp;nbsp;&amp;raquo;&amp;nbsp;' . sprintf(__( 'Read more about: %s &amp;nbsp;&amp;raquo;', 'pietergoosen' ), get_the_title()) . '&lt;/a&gt;'; 
  $excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end); 
  
  //$pos = strrpos($wpse0001_excerpt, '&lt;/');
  //if ($pos !== false)
  // Inside last HTML tag
  //$wpse0001_excerpt = substr_replace($wpse0001_excerpt, $excerpt_end, $pos, 0);
  //else
  // After the content
  $wpse0001_excerpt .= $excerpt_end;
  
  return $wpse0001_excerpt;
  
  }
  return apply_filters('wpse0001_custom_wp_trim_excerpt', $wpse0001_excerpt, $raw_excerpt);
  }
  
  endif; 
  
  remove_filter('get_the_excerpt', 'wp_trim_excerpt');
  add_filter('get_the_excerpt', 'wpse0001_custom_wp_trim_excerpt');
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the section of code I need to modify, but not sure how</p>
  
  <pre><code>$wpse0001_excerpt = substr( $wpse0001_excerpt, 0, strpos( $wpse0001_excerpt, '&lt;/p&gt;' ) + 4 );
  </code></pre>