function tpl_request_replace($tpl) {
global $_REQUEST, $_GET, $_POST;
$global_array = array('get' => $_GET, 'post' => $_POST, 'request' => $_REQUEST);
return $global_array[$tpl[1]][$tpl[2]];
}
// пример //
// get => index.php?name=Vasya&id=100500
$tpl = 'some text hi %get:id% %get:p% some text';
echo preg_replace_callback('#%(request|get|post):(.*)%#isU', 'tpl_request_replace', $tpl);