RE: Find and replace in a string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I have a sting that contains some occurances of "{...}" sub-strings,
where
> "...." is some text.
> Which is the way to find and replace the "{...}" with an other of my
own.
> This sub-strings start with "{" and end with "}".

If you know what the text is between { and }, then use

$new_str = str_replace("{test}","replacement",$old_str);

If you don't, then you can use a regular expression to match and replace
it.

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux