2012-11-11 2 views

답변

1

을 수행하는 방법이 굼벵이에게

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; 
} 
을 생성하는 기능입니다
관련 문제