public function get_url_by_regex($url = null,$replaces = null,$suffix = null)
{
$tmp = explode('?',empty($url) ? $_SERVER['REQUEST_URI'] : $url);
$url = 0<count($tmp) ? array_shift($tmp) : '';
$tmp = 0<count($tmp) ? array_pop($tmp) : '';
$tmp = explode('&',$tmp);
for($i=0;$i<count($replaces);$i+=2){
foreach ($tmp as $j => $q){
$tmp[$j] = preg_replace($replaces[$i],$replaces[$i+1],$q);
}
}
$tmp = array_diff($tmp,array(''));
$is_empty = empty($tmp);
return $url.($is_empty?'':'?'.implode('&',$tmp)) . (is_null($suffix)?'':($is_empty?'?':'&').preg_replace('/^[\?&]/','',$suffix));
}