PHP SEO 链接 优化 /SEO URL
PHP SEO 链接 优化 /SEO URL
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php function seo_url($str){ /** by Jonatas Urias B Teixeira **/ $a = array('/(à|á|â|ã|ä|å|æ)/','/(è|é|ê|ë)/','/(ì|í|î|ï)/','/(ð|ò|ó|ô|õ|ö|ø|œ)/','/(ù|ú|û|ü)/','/ç/','/þ/','/ñ/','/ß/','/(ý|ÿ)/','/(=|\+|\/|\\\|\.|\'|\_|\\n| |\(|\))/','/[^a-z0-9_ -]/s','/-{2,}/s'); $b = array('a','e','i','o','u','c','d','n','ss','y','-','','-'); return trim(preg_replace($a, $b, strtolower($str)),'-'); } echo seo_url("hello world?"); print_r hello-world ?> |
[…]