Posted By

giak on 01/13/10


Tagged

array pregreplace


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

netzwerktourist


PHP : Convert Word characters


 / Published in: PHP
 

URL: http://www.giacomel.fr

  1. // Convert word special characters
  2. function word_annihilator ($text){
  3. $pattern = array( '/(« )|( »)|(_ )|( _)/' ,
  4. '/_/' ,
  5. '/_/' ,
  6. "#&\#8201;#si" );
  7. $replace = array( '"' ,
  8. '\'' ,
  9. '...' ,
  10. " " );
  11. $text = preg_replace( $pattern , $replace , $text );
  12. return $text;
  13. }

Report this snippet  

You need to login to post a comment.