Posted By

sveggiani on 01/05/09


Tagged

strings evFunctions


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

pezland
BrianCoyDesign


evFirstParagraph | extracts first HTML paragraph from a string


 / Published in: PHP
 

  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  

You need to login to post a comment.