创建用户友好的日志缩略名。

JavaScript
4 行
function create_slug($string){
$slug=preg_replace('/[^A-Za-z0-9-]+/', '-', $string);
return $slug;
}