note 51329 added to function.preg-replace

From: Date: Sun, 27 Mar 2005 20:01:11 +0000
Subject: note 51329 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-87064@lists.php.net to get a copy of this message
Here is a way to replace usual characters from MS Word to xhtml conform codes. I used it to make form-texts that are pasted from a Word document xhtml valid. Bullet <?php $contentText = preg_replace("/\x95/","&#8226;",$contentText); ?> Long dashes <?php $contentText = preg_replace("/\x96/","-",$contentText); $contentText = preg_replace("/\x97/","-",$contentText); ?> ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51329 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51329&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51329&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51329&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51329&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51329&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51329&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87064) next »