PHP code example of kazemmdev / slug

1. Go to this page and download the library: Download kazemmdev/slug library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kazemmdev / slug example snippets




use Kazemmdev\Slug\Slug;

Slug::handle(string: 'sample text!!??'); // 'sample-text'
Slug::handle(string: 'sample-- --text'); // 'sample-text'
Slug::handle(string: 'SamPle-tExt'); // 'sample-text'
Slug::handle(string: 'نمونه متن'); // 'نمونه-متن'
Slug::handle(string: 'عينة النص'); // 'عينة-النص'
Slug::handle(string: 'عينةْ اًلنصٌ'); // 'عينة-النص'
Slug::handle(string: 'sample text', separator:  '+'); // 'sample-text'