PHP code example of alexskrypnyk / str2name

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

    

alexskrypnyk / str2name example snippets


<php

use AlexSkrypnyk\Str2Name\Str2Name;

class MyClass {

    public function myMethod() {
        $string = 'string to convert';
        // Convert string to machine name.
        $string = Str2Name::machine($string);
    }

}

<php

use AlexSkrypnyk\Str2Name\Str2Name;

class MyClass {

    public function myMethod() {
        $string = 'string to convert';
        // Convert string to machine name.
        $string = Str2Name::machine($string);
    }

}