1. Go to this page and download the library: Download hopr/pipeable 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/ */
// Won't be executed until called later !
$extract_user_email = map(fn(User $user) => $user->email);
// Some logic ...
// Executed here
$email = $extract_user_email($current_user);
use function Hopr\Pipeable\Array\map;
use function Hopr\Pipeable\Array\filter;
use function Hopr\Pipeable\Array\reduce;
$data = [1, 2, 3, 4, 5];
$result = $data
|> map(fn($x) => $x * 2) // [2, 4, 6, 8, 10]
|> filter(fn($x) => $x > 5) // [6, 8, 10]
|> reduce(fn($carry, $item) => $item + $carry, 0); // 24
echo $result; // Output: 24
use function Hopr\Pipeable\String\chunk;
use function Hopr\Pipeable\String\map;
use function Hopr\Pipeable\String\join;
use function Hopr\Pipeable\String\toUpper;
$string = "hello world";
$result = $string
|> chunk(5) // ["hello", " worl", "d"]
|> map(fn($x) => $x |> toUpper(...)) // ["HELLO", " WORL", "D"]
|> join("-"); // "HELLO- WORL-D"
echo $result; // Output: "HELLO- WORL-D"
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.