PHP removing html tags from string -
i have string:
<p justify;"="">verslo centrai lietuvos nekilnojamojo turto plėtros asociacijos konkurse ...</p>
and want want remove tag
<p justify;"=""></p>
my code:
$content = strip_tags($text, '<p>');
but empty string: string(0) ""
, wrong ?
try put
$content = strip_tags($text);
or can regular expression that:
$content = preg_replace('/<[^>]*>/', '', $text);
by $content = strip_tags($text, '<p>');
allowing <p>
tag in string.
for more info see link http://php.net/manual/en/function.strip-tags.php
Comments
Post a Comment