Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

hmtl remove tag php

<?php
function strip_tags_content($text, $tags = '', $invert = FALSE) {

  preg_match_all('/<(.+?)[s]*/?[s]*>/si', trim($tags), $tags);
  $tags = array_unique($tags[1]);
   
  if(is_array($tags) AND count($tags) > 0) {
    if($invert == FALSE) {
      return preg_replace('@<(?!(?:'. implode('|', $tags) .'))(w+).*?>.*?</1>@si', '', $text);
    }
    else {
      return preg_replace('@<('. implode('|', $tags) .').*?>.*?</1>@si', '', $text);
    }
  }
  elseif($invert == FALSE) {
    return preg_replace('@<(w+).*?>.*?</1>@si', '', $text);
  }
  return $text;
}
?>
 
PREVIOUS NEXT
Tagged: #hmtl #remove #tag #php
ADD COMMENT
Topic
Name
7+7 =