How to find/replace?
Posted: Sun Jul 27, 2003 3:13 pm
Hi, I'm trying to be able to Find and Replace any text on a web page. I've got input fields, etc., but I put the simplified version into a simple PHP page as such:
<? $string = "all the pizza and macaroni and page text in here!";
preg_replace('pizza','macaroni',$string); ?>
but I get the following error:
Warning: Delimiter must not be alphanumeric or backslash in <...>/TestingFindReplace.php on line 2
Also, instead of [<? $string = "all the...here!";] which would require pasting new text in there each time the page is updated, is there an automated way you could just have it search the whole file? Thanks!
Chris
<? $string = "all the pizza and macaroni and page text in here!";
preg_replace('pizza','macaroni',$string); ?>
but I get the following error:
Warning: Delimiter must not be alphanumeric or backslash in <...>/TestingFindReplace.php on line 2
Also, instead of [<? $string = "all the...here!";] which would require pasting new text in there each time the page is updated, is there an automated way you could just have it search the whole file? Thanks!
Chris