PHP code example of traderinteractive / filter-strings
1. Go to this page and download the library: Download traderinteractive/filter-strings 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/ */
traderinteractive / filter-strings example snippets
$value = \TraderInteractive\Filter\Strings::compress(' a string with lots of whitespace ');
assert($value === 'a string with lots of whitespace');
$value = \TraderInteractive\Filter\Strings::compress(" a string\nwith lots\nof \nnewlines\n ", true);
assert($value === 'a string with lots of newlines');
$value = \TraderInteractive\Filter\Strings::redact('a string with some unwanted words', ['unwanted', 'words'], '*');
assert($value === 'a string with some ******** *****');
\TraderInteractive\Filter\Strings::stripTags('<div>a string with<br/>tags</div>', ' ');
assert($value === ' a string with tags ');