rogerthomas84 / slugify
生成缩略名
1.0.4
2022-01-17 08:51 UTC
Requires
- php: >=7.1
- ext-iconv: *
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ^6
README
从字符串生成URL安全的缩略名...
使用方法
composer require rogerthomas84/slugify
将字符串转换为缩略名
<?php $string = 'The quick brown fox jumped over the lazy dog.'; $slug = \Slugify\Slugify::get($string); // $slug = string(44) "the-quick-brown-fox-jumped-over-the-lazy-dog" // Slugify also removes any special (non alphanumeric) characters... $string2 = 'The "quick" brown fox jumped (OVER) the lazy dog!'; $slug2 = \Slugify\Slugify::get($string2); // $slug2 = string(44) "the-quick-brown-fox-jumped-over-the-lazy-dog"