Home > php教程 > PHP源码 > PHP 的 SEO优化方法-URL优化

PHP 的 SEO优化方法-URL优化

PHP中文网
Release: 2016-05-25 17:13:55
Original
1926 people have browsed it

PHP 的 SEO优化方法-URL优化

在处理地址URL时,用这个函数可以轻松就把单词用"-"连起来

function getSeoVersion($phrase) {
  return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($phrase))));
}
  
// example usage:
echo getSeoVersion("German cars are amazing.");
Copy after login

以上就是PHP 的 SEO优化方法-URL优化的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template