I've written the following preg_replace function:
function my_foo($bar)
{
$bar = preg_replace(
'/\[blah=(.*)\](.*)(\[\/blah)\]/e',
'"<a href=\"http://blah.com/$1\" title=\"$2 On blah\">$2</a>"',
$bar);
return $bar;
}
So anything wrapped in [blah=boob]Boo[/blah] turns into a link: blah.com/boob
Now I would like to take $1 and do something else with it, how would I go about using $1 or $2 from that preg_replace in other parts of my script?
As always, thank you for any feedback.