How i can replace a string from:
"this is a <p id="1" /> text <p id="2" /> of a string"
To:
"this is a <br> text <br> of a string" ?
Shortly i want replace all <p ... />
present in a string with <br>
.
How i can replace a string from:
"this is a <p id="1" /> text <p id="2" /> of a string"
To:
"this is a <br> text <br> of a string" ?
Shortly i want replace all <p ... />
present in a string with <br>
.
update: (just <p ... />
)
echo preg_replace("/<p[^\/]*\/>/i", "<br />", 'this is a <p id="1" /> text <p id="2" /> of a string');