I want the link destination to have underscores instead of spaces between the words in the link address.
My code looks like:
preg_replace("/\[\[(.+?)\]\]/", '<a href="/XLab/?document=$1">$1</a>', $document->content)
The first occurance of $1 should have underscores instead of spaces.
Thank you!