note 110626 added to function.str-replace
| From: | narenjaz at gmail dot com | Date: | Wed, 14 Nov 2012 11:28:35 +0000 |
| Subject: | note 110626 added to function.str-replace | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191929@lists.php.net to get a copy of this message | ||
$SourceFilePath = 'D:\Desktop\EN_US.xml';
$ToXmlSourceString = file_get_contents($SourceFilePath);
$ReplacePatterns = array("<b>");
$ReplacePatternWith = array("<![CDATA[<b>]]>");
$bodytag = str_replace($ReplacePatterns,$ReplacePatternWith,$ToXmlSourceString,$Count);
echo $bodytag;
echo $Count;
$DestPath = 'D:\Desktop\en.xml';
file_put_contents($DestPath, $bodytag);
**** The problem is, the <b> are not getting replaced with
<![CDATA[<b>]]>") string. Can some one help please.
----
Server IP: 69.147.83.199
Probable Submitter: 20.139.83.50
----
Manual Page -- http://www.php.net/manual/en/function.str-replace.php
Edit -- https://master.php.net/note/edit/110626
Del: integrated -- https://master.php.net/note/delete/110626/integrated
Del: useless -- https://master.php.net/note/delete/110626/useless
Del: bad code -- https://master.php.net/note/delete/110626/bad+code
Del: spam -- https://master.php.net/note/delete/110626/spam
Del: non-english -- https://master.php.net/note/delete/110626/non-english
Del: in docs -- https://master.php.net/note/delete/110626/in+docs
Del: other reasons-- https://master.php.net/note/delete/110626
Reject -- https://master.php.net/note/reject/110626
Search -- https://master.php.net/manage/user-notes.php