PHP code example of omarwebdev / plass

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

    

omarwebdev / plass example snippets


$str = "Some String";

echo $str; // prints "Some String"

use OmarWebDev\Plass\Facade\Str;

$str = new Str('Some String');

echo $str; // prints "Some String"

use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String'); // same as new Str('Some String')

echo $str; // prints "Some String"


use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String')
            ->toUpperCase();
echo $str; // prints "SOME STRING"

use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$str = (string) $str; // returns "Some String"

use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$str = $str->toString(); // same as (string) $str

use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Some String');

$char = $str->charAt(0); // returns "S"
$char = $str[0]; // returns "S"

use OmarWebDev\Plass\Facade\Str;

$str = Str::of('Example');

$str[0] = 'R'; // changes letter "E" to "R"
$str[] = ', Hello'; // adds ", Hello" to the string
unset($str[0]); // removes the first letter in the string
$str[0] = ''; // removes the first letter in the string
echo $str; // prints "ample, Hello"