PHP code example of mpstenson / laravel-advanced-string

1. Go to this page and download the library: Download mpstenson/laravel-advanced-string 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/ */

    

mpstenson / laravel-advanced-string example snippets


Str::redactSsn('My social security number is 222-22-2222'); // My social security number is xxxxxx

AdvStr::redactSsn('My social security number is 222-22-2222'); // My social security number is xxxxxx

return [

    /*
    // Macro the AdvStr class to the Illuminate\Support\Str class. You can disable
    // this here if you don't want the AdvStr methods available on the Str class
    */

    'use_str' => true,

];

Str::redactSsn('123-45-6789')

public static function advPassword(
    $length = 32,
    $letters = true,
    $numbers = true,
    $symbols = true,
    $spaces = false,
    $upperLetters = false,
    $lowerLetters = false,
    $exclude = []
)

public static function charWrap(
    $string, 
    $length = 80
)

public static function emailDomain(
    $string
)

public static function randomPhrase(
    $wordCount,
    $separator = '-'
)

public static function randomWord(
)

public static function readTime(
    $string, 
    $wpm = 200
)

public static function redactCreditCard(
    $string, 
    $redacted = '********', 
    $exclude = []
)

public static function redactSsn(
    $string, 
    $redacted = '********', 
    $dashes = true, 
    $noDashes = true
)

public static function splitName(
    $name
)