0
나는 wordpress와 마찬가지로 페이지, 카테고리 등을 생성하고 싶습니다. 페이지 제목이 있습니다. "My Page Title" 그런 다음 공백과 특수 문자를 이스케이프하고 "my-page -title " 는SEF 굼벵이 또는 URL을 생성하는 방법
나는 wordpress와 마찬가지로 페이지, 카테고리 등을 생성하고 싶습니다. 페이지 제목이 있습니다. "My Page Title" 그런 다음 공백과 특수 문자를 이스케이프하고 "my-page -title " 는SEF 굼벵이 또는 URL을 생성하는 방법
을 수행하는 방법이 굼벵이에게
function slug($var){
$seoname = preg_replace('/\%/',' percentage',$var);
$seoname = preg_replace('/\@/',' at ',$seoname);
$seoname = preg_replace('/\&/',' and ',$seoname);
$seoname = preg_replace('/\s[\s]+/','-',$seoname); // Strip off multiple spaces
$seoname = preg_replace('/[\s\W]+/','-',$seoname); // Strip off spaces and non-alpha-numeric
$seoname = preg_replace('/^[\-]+/','',$seoname); // Strip off the starting hyphens
$seoname = preg_replace('/[\-]+$/','',$seoname); // // Strip off the ending hyphens
$seoname = strtolower($seoname);
return $seoname;
}
을 생성하는 기능입니다