PHP code example of enricodias / nameize

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

    

enricodias / nameize example snippets




echo \enricodias\Nameize::create()->name("Carlo D'ippoliti"); // Carlo D'Ippoliti

$nameize = new \enricodias\Nameize();

echo $nameize->name("Matteo Dell'aqcua");  // Matteo Dell'Aqcua
echo $nameize->name("john o'grady-smith"); // John O'Grady-Smith

$nameize = new \enricodias\Nameize();

$nameize->setAllowedCharacters("'");

echo $nameize->name("Matteo Dell'aqcua");  // Matteo Dell'Aqcua
echo $nameize->name("john o'grady-smith"); // John O'Grady-smith

echo \enricodias\Nameize::create()
    ->setAllowedCharacters("-")
    ->name("john o'grady-smith"); // John O'grady-Smith

$nameize = new \enricodias\Nameize();

$nameize->setMinLength(1);

echo $nameize->name("Tri vu phu");    // Tri Vu Phu
echo $nameize->name("Shuanping dai"); // Shuanping Dai

echo \enricodias\Nameize::create()
    ->setMinLength(1)
    ->name("Tri vu phu"); // Tri Vu Phu
array("'", '-')