PHP : Convert Word characters


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



Copy this code and paste it in your HTML
  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. }

URL: http://www.giacomel.fr

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.