php - Str_replace not removing tags in message string -
php - Str_replace not removing tags in message string -
i echoing contents of table using foreach, problem getting date @ top of page, when looking @ 1 line preview date , nil more. if remove date fine , can see first line of template. trying remove date tag preview using each. using next code, doesnt seem doing lot, far can see have things right ?.
echo '<div class="messagerow">'; // pulls message foreach above $emlmsg = $row->emailformmessage; // trying remove date replacing blank contents of string value. $dateremove = ''; // str_replace supposed remove {date} tag along paragraph tags wrapped in. $emlmsgfiltered = str_replace(array('<p>{date}</p>'), array($dateremove), $emlmsg); // echo filtered message here, minus date....but still there ?? echo $emlmsgfiltered; echo '</div>';
edit >>>>>>
requested, html code <p>{date}</p> <p>dear {name} thankyou order, if need more oil happy provide competitive quote.</p> <p>kind regards</p> {createdby}
sorry . should have been ansewr, not comment:
why array around first value in str_replace()? supposed referencing array element
str_replace('<p>{date}</p>',$dateremove,$emlmsg)
php mysql echo str-replace
Comments
Post a Comment