Im tring to use this:
What it's supposed to do, is take something likePHP Code:function prep_data($string) {
$intro_string = preg_replace ('/(.*)?\\[intro\\]/i', '', $string);
$intro_string = preg_replace ('/\\[\/intro\\](.*)/i', "", $intro_string);
// now finish off $string
$string = preg_replace('/\\[intro](.*)?\\[\/intro\\]/i', "", $string);
// run through text->links function
//$intro_string = $this->textlinks($intro_string);
//$string = $this->textlinks($string);
$fd = array("intro" => $intro_string, "body" => $string);
return $fd;
}
[intro]
This is intro!
[/intro]
This is the body
And seperate it into 2 strings, one being "This is intro!" and the other being "This is the body"
Now, it only works if it is like this:
[intro]This is intro![/intro]This is the body
So what am I doing wrong? (this is my first self written regex, if it's even called that)






Bookmarks