PHP code example of rogerthomas84 / slugify
1. Go to this page and download the library: Download rogerthomas84/slugify 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/ */
rogerthomas84 / slugify example snippets
$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"