Ich habe einen Text, der auch <br> enthält (kommt so aus der Datenbank). Er sieht etwa so aus:
Ich würde gerne immer wenn solche 2 <br> hintereinander kommen diese umparsen zu </p><p>, wenn nur ein <br> kommt soll dieses stehen bleiben.
Mein str_replace sieht momentan so aus:
Wie muss es korrekt heißen?
Text Text Text Text Text Text Text Text Text Text Text<br>
<br>
Text2 Text2 Text2 Text2 Text2 Text2 Text2 Text2 Text2.
<br>
Text2 Text2 Text2 Text2 Text2 Text2 Text2 Text2 Text2.
Mein str_replace sieht momentan so aus:
Code:
$_test = "%CMS(FIELD[4])";
$_test = str_replace(
array("<br>\n<br>", "[b]", "[/b]"),
array("</p>\n\n<p>", "<strong>", "</strong>"),
$_test
);
Wie muss es korrekt heißen?

Comment