PHP code example of zuffik / srvant

1. Go to this page and download the library: Download zuffik/srvant 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/ */

    

zuffik / srvant example snippets


$list = new ArrayList();
$list->add(1, 2, 3, -1);
foreach($list as $item) {
	echo $item . "\n";
}
// And equivalent
$list->map(function($item) {
	echo $item . "\n";
	return $item;
})->filter(function($item) {
	return $item > 0;
});
// And many more

$str = string('Hallo world')
	->replace('a', 'e')
	->lowerCase()
	->slugify()
	->upperCase();
echo $str; // HELLO-WORLD

$url = new URL('http://sub.example.com/index.php?action=page');
echo $url->getDomain(); // example
echo $url->getRequestedUrl(); // index.php