PHP removing html tags from string -


i have string:

<p justify;"="">vers­lo cent­rai lie­tu­vos ne­kil­no­ja­mo­jo turto plėt­ros aso­cia­ci­jos kon­kur­se  ...</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

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -