Home > Article > Backend Development > PHP SEO optimization method-URL optimization (not suitable for Chinese)
When processing address URLs, you can use this function to easily connect words with "-", which is not suitable for Chinese.
function getSeoVersion($phrase) { return preg_replace('/[^a-z0-9_-]/i', '', strtolower(str_replace(' ', '-', trim($phrase)) );
|