Replace any text from html text by tag name in php
function replace_tag_text($tagName,$subjectStr,$replaceStr) { $tagName = preg_quote($tagName); preg_match_all(‘{<‘.$tagName.'*>(.*?)</’.$tagName.’>}’,$subjectStr,$matches,PREG_PATTERN_ORDER); $result = str_replace($matches,$replaceStr,$subjectStr); return $result; } Usage :…
Read More