PHP code example of salmanbe / filename

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

    

salmanbe / filename example snippets


Salmanbe\FileName\FileNameServiceProvider::class,

'Filename' => Salmanbe\FileName\FileName::class,

$filename = 'visa-_ application With fréé.PNG';

echo FileName::get($filename);  // visa-application-with-free-2021-02-16-001454.png

echo FileName::get($filename, ['timestamp' => 'Y-m-d']]);

echo FileName::get($filename, ['slugify' => true]]);

echo FileName::get($filename, ['limit' => 200]]);

echo FileName::get($filename, ['separator' => '_']]);

echo FileName::get($filename, ['uppercase' => true]]);

echo FileName::get($filename, [
            'limit' => 200,
            'timestamp' => date('d-m-Y-His'),
            'slugify' => true,
            'separator' => '-',
            'uppercase' => true
    ]);

'timestamp' => 'Y-m-d-His',

'limit' => 225,

'slugify' => true,

'separator' => '-',

'uppercase' => false,