If you are using output buffering, it’s pretty simple. Add this code at the bottom. It will parse text that are marked with [[..]] and transform it inot a link to the selected wiki page. so a text like [[wiki]] will transform into
$contents = ob_get_contents();Â Â Â Â Â
$yourwikipage="/mediawiki/index.php";Â
ob_clean ( );Â Â Â Â Â
$pattern = '/\[\[(([^\]]*?))\]\]/';Â Â Â Â Â
// $pattern = "/<<(.*)>>/is"; Â Â Â Â
$contents = preg_replace($pattern, "</a><a href="%5C%22$yourwikipage/$1%5C%22" target="wiki">$1</a>", $contents); Â Â Â Â
print ($contents);Â Â Â Â Â Â