Is it possible to find all <p>
tabs in a string and replace them with <br>
tabs?
For example, if I have a string which looks like this:
<p>some test here</p>
<p>some more test here</p>
<p>some other test here</p>
Is it possible to change it to the following:
some test here<br /><br />
some more test here<br /><br />
some other test here<br /><br />
In what language? PHP?
$text=str_replace(array('<p>','</p>'),array('','<br /><br />'),$text);
You can do a regExp replace in NotePad++ :
find :
<p>(.*)</p>
replace :
\1<br /><br />
But I advise you to change the <p>
CSS Class to play with margin-bottom instead of adding <br>
p {
margin : 0 0 2em 0;
}
<?php
$pattern = '/<p>(.*)<\/p>/';
$replacement = '/${1}<br\/><br\/>/';
echo preg_replace($pattern, $replacement, $string);
?>