PHP code example of wernerdweight / canonicalizer
1. Go to this page and download the library: Download wernerdweight/canonicalizer 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/ */
wernerdweight / canonicalizer example snippets
use WernerDweight\Canonicalizer\Canonicalizer;
$string = 'This is an interesteing string with some strange cháračtěřš in it. Хорошо?'
$maxLength = 255; // maximal resulting canonical length (excessive chars will be trimmed)
$canonicalizer = new Canonicalizer($maxLength);
$canonical = $canonicalizer->canonicalize($string);
echo $canonical; // this-is-an-interesting-string-with-some-strange-characters-in-it-choroso