PHP 去除url参数中出现+、空格、=、%、&、#等字符的解决办法, PHP去除影响url路径的字符
/* * 去除url参数中出现+、空格、=、%、&、#等字符的解决办法 * */ function get_url_str($title){ if($title){ $zifu = array( 0 => '+', 1 => '/', 2 => '?', 3 => '?', 4 => '%', 5 => '#', 6 => '&', 7 => '=', ); $s_title = $title; foreach ($zifu as $k=>$r) { $s_title = str_replace($r,'-',$s_title); } //dump($s_title);die(); return $s_title; } }