I have below function for SEO parameter, somehow when url contains characters other than alphabet, it will strip off and page will direct to 404, some of my url will contains Chinese character, how can it be accepted Chinese character instead?
public function seoUrl($string)
{
//Lower case everything
$string = strtolower($string);
//Make alphanumeric (removes all other characters)
$string = preg_replace("/[^a-z0-9_\s-]/", "", $string);
//Clean up multiple dashes or whitespaces
$string = preg_replace("/[\s-]+/", " ", $string);
//Convert whitespaces and underscore to dash
$string = preg_replace("/[\s_]/", "-", $string);
return $string;
}