PHP code example of mscribellito / str

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

    

mscribellito / str example snippets




$lipsum = new Str("Lorem ipsum dolor sit amet");
$search = "ipsum";
if ($lipsum->contains($search)) {
    printf("'%s' contains '%s'", $lipsum, $search);
    // 'Lorem ipsum dolor sit amet' contains 'ipsum'
}

$lipsum = Str("Lorem ipsum dolor sit amet");

$str = new Str('php');
echo $str->toUpperCase()->concat(' is a popular general-purpose scripting language');
// PHP is a popular general-purpose scripting language