PHP code example of twipsi / normalizer

1. Go to this page and download the library: Download twipsi/normalizer 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/ */

    

twipsi / normalizer example snippets


$string = "Hel  lo <br><div>Wor
ld</div>";

Normalizer::normalizeString($string);

Output: "Hello World"

$string = "Hél  lö <br><div>Wőr
ld</div>";

Normalizer::normalizeString($string, true);

Output: "Hello World"

$string = "H\\él/ló|W_ö+r l-d";

Normalizer::slugifyString($string);

Output: "h-el-lo-w-o-r-l-d"

$string = "H\\él/ló|W_ö+r l-d";

Normalizer::slugifyString($string, '_');

Output: "h_el_lo_w_o_r_l_d"

$string = "https:://test.com/Tést page/Sep|ar_ate+Thís/?örg=éáő";
Normalizer::slugifyPath($string);

Output: "https:://test.com/test-page/sep-ar-ate-this/?org=eao"

$string = "https:://test.com/Tést page/Sep|ar_ate+Thís/?örg=éáő";

Normalizer::slugifyPath($string, '_');

Output: "https:://test.com/test_page/sep_ar_ate_this/?org=eao"