12-04-2007, 08:17 AM
|
#3 (permalink)
|
|
The Acquainted
Join Date: Sep 2007
Posts: 126
Thanks: 4
|
Quote:
Originally Posted by SOCK
Are we assuming the string will always be the same, e.g. some text embedded within image tags with image names?
Use a regular expression to weed out anything between and including the opening and closing [ image ] tags.
|
Thanks!
Like so?
PHP Code:
$searchfor = array(
'#\[rightimage\](.*?)\[/rightimage\]#',
'#\[image\](.*?)\[/image\]#'
);
$replacewith = array(
'',
''
);
return preg_replace($searchfor , $replacewith, $text);
|
|
|
|