HI,
I am trying to echo out a html template page that is stored in the database but need to omit some data before it echoes, this is the method:
PHP Code:$newbody = $row2['body'];
$newtext1 = "bbbbb";
// use preg_replace to replace text
$newbody = preg_replace ('#%%NAME%%#', $newtext1, $newbody);
echo $newbody;
But I need it to find the text below not this '('#%%NAME%%#','
Dear %%NAME%%,
I tried doing this but get a blank page error when trying to load page:
Can anyone please help?PHP Code:$newtext1 = "bbbbb";
$replacetext1 = "Dear %%NAME%%,";
$newbody = preg_replace ($replacetext1, $newtext1, $newbody);




Bookmarks