PHP code example of maatify / php-slug
1. Go to this page and download the library: Download maatify/php-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/ */
maatify / php-slug example snippets
$profiles = SlugProfileRegistryFactory::createBuiltIn();
$text = SlugTextServiceFactory::create($profiles);
$slug = $text->generateFromSource(
new SlugProfileKey('ascii-v1'),
'Hello, World!',
);
// $slug->slug->value === 'hello-world'
bash
composer