Skip to content Skip to sidebar Skip to footer

Problem Using Strip_tags In Php

I have used strip_tags to remove html tags from the text. Example

title of article

The content goes here......
outputs

Solution 1:

If all you want is to add a space where an opening tag directly follows a closing tag, you could do this:

$html = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $html);
$html = strip_tags($html);

Post a Comment for "Problem Using Strip_tags In Php"