Teddy Zugana
Posted on November 28, 2019
function seo_friendly_url($string){
$string = str_replace(array(‘[\’, \’]’), ”, $string);
$string = preg_replace(‘/[.*]/U’, ”, $string);
$string = preg_replace(‘/&(amp;)?#?[a-z0-9]+;/i’, ‘-‘, $string);
$string = htmlentities($string, ENT_COMPAT, ‘utf-8’);
$string = preg_replace(‘/&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);/i’, ‘\1’, $string );
$string = preg_replace(array(‘/[a-z0-9]/i’, ‘/[-]+/’) , ‘-‘, $string);
return strtolower(trim($string, ‘-‘));
}rim($string, ‘-‘));
}
💖 💪 🙅 🚩
Teddy Zugana
Posted on November 28, 2019
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
laravel How to Create a Sitemap in Laravel for a Website that Contains Thousands of Records.
October 30, 2020