evFirstParagraph | extracts first HTML paragraph from a string


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // name: evFirstParagraph
  2. // version: v0.2
  3. // description: extrae el primer párrafo de una cadena dada
  4.  
  5. function evFirstParagraph( $paragraph ) {
  6.  
  7. $firs_par = explode( '</p>', $paragraph );
  8. $firs_par_output = strip_tags( $firs_par[0] );
  9.  
  10. return( $firs_par_output );
  11.  
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.