1. Go to this page and download the library: Download pataar/smartstring 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/ */
pataar / smartstring example snippets
\Pataar\SmartString::create("Sample String");
new \Pataar\SmartString("Sample String");
$sampletext = "Sample String";
echo \Pataar\SmartString::create($sampletext)->remove("String")->trim();
//which would echo "Sample"
echo \Pataar\SmartString::create($sampletext)->prefix("A new ")->normalize();
//which would echo "a-new-sample-string"
echo \Pataar\SmartString::create($sampletext)->toMd5WithSalt("Salting is good");
//which would echo "560fbd0056c4354c5dd0de0580c8c523"
echo \Pataar\SmartString::create($sampletext)->remove("String")->trim()->toLower()->prefix("String ");
//which would echo "String sample"