PHP code example of josalba / stringplus-php

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

    

josalba / stringplus-php example snippets


 $text = StringPlus::create('Lorem Ipsum');

 'Lorem Ipsum'

 $text = StringPlus::ors('',null,'Lorem Ipsum','','is');

 'Lorem Ipsum'

 $text = StringPlus::create('')
    ->or(null)
    ->or('Lorem Ipsum')
    ->or('')
    ->or('is');

 'Lorem Ipsum'

 $text = StringPlus::create('Lorem Ipsum')
            ->concat('')
            ->concat(null)
            ->concat('is simply dummy text of the printing and typesetting industry.')
            ->concat('');

 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.'

 $isIn = StringPlus::create('Lorem Ipsum')->in('Ipsum');

 if($isIn === true){
    echo "OK.";
 }

 $length = StringPlus::create('Lorem Ipsum')->getLength();

 $isEquals = StringPlus::create('Lorem Ipsum')->equals('Lorem Ipsum');

 if($isIn === true){
    echo "Es igual.";
 }

 $md5 = StringPlus::create('Lorem Ipsum')->toMd5();
composer