在处理地址url时,用这个函数可以轻松就把单词用-连起来 ,不适合中文哦
function getseoversion($phrase) { return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($phrase))));} // 使用方法echo getseoversion(german cars are amazing.);//返回结果german-cars-are-amazing
复制代码