LoginSignup
5
6

More than 5 years have passed since last update.

PHPで特定のHTMLタグのみを除去

Posted at

特定のタグを除去する機能

   function removeHtmlTags($html, $tag){
       $reg = '/<' .$tag .'.*?>|<\/' .$tag .'>/mis';
       $escape = preg_replace($reg, '', $html);
       return $escape;
   }

(´﹃`)

5
6
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6