标签:
function get_url_params($url, $arg_name) { $regx = ‘/.*[&|\?]‘. $arg_name .‘=([^&]*)(.*)/‘; preg_match($regx, $url, $match); return $match[1]; } $str = $_SERVER[‘HTTP_HOST‘].$_SERVER[‘PHP_SELF‘].‘?‘.$_SERVER[‘QUERY_STRING‘]; var_dump($str); //preg_match(‘/.*[&|\?]a=([^&]*)(.*)/‘, $str, $match); //var_dump($match); echo get_url_params($str, ‘e‘); $temp_str = ‘http://xsimon.cn/mm/cc/mm.php?aa=11‘; $token = strtok($temp_str, ‘?‘); $pos = strrpos($token, ‘/‘); $token = substr($token, 0, $pos+1); var_dump($token);
标签:
原文地址:http://www.cnblogs.com/yll-sww/p/4626456.html