php Match and replace

gals

New Member
I want to replace every link I find within a string, with a modified version of the string, say for example:\[quote\] The quick brown fox jumped over the http://www.google.com/?v=abc and http://www.google.com/?v=x_y-z
I would replace (and modify) the links in this so it becomes: http://www.google.com/v/abc and http://www.google.com/v/x_y-z \[/quote\]I know how to find all the links using preg_match_all($pattern, $text, $out, PREG_SET_ORDER);and I can manipulate the strings using preg_split etc - This is done one at a time.The outcome I'm looking for is:\[quote\] The quick brown fox jumped over the http://www.google.com/v/abc and http://www.google.com/v/=x_y-z
However how could I match and replace all of them? Any help would be greatly appreciated.\[/quote\]
 
Back
Top