find and replace with php
Let's say, for example, i have a set of strings, and one of them is like:
hahahaha haha
hahaha more haha
hahahaha haha
hahaha more haha
Basically, I want to get replace all of the with , except it has to be that, and it also has to get rid of the ending . And it has to include the closing tag.
Hopefully this was clear enough. Thanks for any help you may offer!
Mark Hensler posted this at 06:36 — 16th December 2001.
He has: 4,048 posts
Joined: Aug 2000
<?php
$text = preg_replace(\"#<font size=\\"3\\">(.*)</font>#iU\", \"<p class=\\"whatever\\">\\\\1</p>\", $text);
?>
Mark Hensler
If there is no answer on Google, then there is no question.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.