protected function reserveTag($content, $tag)
    {
        if (stripos($content, '<' . $tag) !== false) {

            if (in_array(strtolower($tag), array('img'))) {
                $pattern = '~(<' . preg_quote($tag, '~') . '[^>]+\>)~i';
            } else {
                $pattern = '~(<' . preg_quote($tag, '~') . '\\b[^>]*?>[\\s\\S]*?<\\/' . preg_quote($tag, '~') . '>)~i';
            }

            return preg_replace_callback($pattern, array($this, 'placeHolder'), $content);
        }

        return $content;
    }
protected function reserveTag($content, $tag)
    {
        if (stripos($content, '<' . $tag) !== false) {

            if (in_array(strtolower($tag), array('img'))) {
                $pattern = '~(<' . preg_quote($tag, '~') . '[^>]+\>)~i';
            } else {
                $pattern = '~(<' . preg_quote($tag, '~') . '\\b[^>]*?>[\\s\\S]*?<\\/' . preg_quote($tag, '~') . '>)~i';
            }

            return preg_replace_callback($pattern, array($this, 'placeHolder'), $content);
        }

        return $content;
    }
protected function reserveTag ( $ content , $ tag ) { if ( stripos ( $ content , '<' . $ tag ) !== false ) { if ( in_array ( strtolower ( $ tag ) , array ( 'img' ) ) ) { $ pattern = '~(<' . preg_quote ( $ tag , '~' ) . '[^>]+\>)~i' ; } else { $ pattern = '~(<' . preg_quote ( $ tag , '~' ) . '\\b[^>]*?>[\\s\\S]*?<\\/' . preg_quote ( $ tag , '~' ) . '>)~i' ; } return preg_replace_callback ( $ pattern , array ( $ this , 'placeHolder' ) , $ content ) ; } return $ content ; }
Reserves a tag, which in this case, all it does is replace the html tag
with a placeholder.

@param string $content
@param string $tag
@return string
Reserves a tag which in this case all it does is replace the html tag with a placeholder .