Reputation: 38805
Suppose I have the code below, how can I only remove the HTML tag of <p>
and </p>
?
Thanks
<p>This is the first line<br /> This is the second line with image <img src="1.jpg" /></p>
Upvotes: 0
Views: 254
Reputation: 8923
Your looking for the str_replace function.
mixed str_replace ( mixed $search , mixed $replace , mixed $subject [, int &$count ] )
<?php
$str = '<p>This is the first line<br /> This is the second line with image <img src="1.jpg" /></p>'
echo str_replace(array('<p>', '</p>'), NULL, $str);
?>
Upvotes: 1