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

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -