1. Go to this page and download the library: Download slpxxv/stdlib 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/ */
use Slpxxv\Stdlib\Map\Map;
$map = new Map(['answer' => null]);
$map->has('answer'); // true
$map->get('answer', 42); // null
$map->get('missing', 42); // 42
$map->
use Slpxxv\Stdlib\Set\Set;
$left = new Set([1, 2]);
$right = new Set([2, 3]);
$left->union($right)->all(); // [1, 2, 3]
$left->intersect($right)->all(); // [2]
$left->diff($right)->all(); // [1]
use Slpxxv\Stdlib\LazySequence;
$lines = new LazySequence(static function (): iterable {
$file = new SplFileObject('large.csv');
foreach ($file as $line) {
yield $line;
}
});
$firstTenNonEmptyLines = $lines
->filter(static fn(string $line): bool => trim($line) !== '')
->take(10)
->toArray();
use Slpxxv\Stdlib\XML\CanonicalizationAlgorithm;
use Slpxxv\Stdlib\XML\XmlCanonicalizer;
$canonicalXml = XmlCanonicalizer::canonicalize(
$document,
CanonicalizationAlgorithm::Exclusive,
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.