1. Go to this page and download the library: Download andres-ml/fpl 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/ */
andres-ml / fpl example snippets
use function Aml\Fpl\{compose, partial, last};
$lastWord = compose(last(...), partial(explode(...), ' '));
$lastWord('some words in a sentence'); // 'sentence'
// idiomatic php
'some words in a BUG sentence'
|> (fn($x) => explode(' ', $x))
|> (fn($x) => array_filter($x, fn(string $word) => $word !== 'BUG'))
|> (fn($x) => explode(' ', $x));
// 'some words in a sentence'
// with this library
use function Aml\Fpl\{partial as _, filter};
'some words in a BUG sentence'
|> _(explode(...), ' ')
|> filter(fn(string $word) => $word !== 'BUG')
|> _(implode(...), ' ');
// 'some words in a sentence'