PHP code example of enzyme / collection
1. Go to this page and download the library: Download enzyme/collection 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/ */
enzyme / collection example snippets
use Acme\Mailer;
use Enzyme\Collection\Collection;
$users = new Collection(['John123', 'Jane456', 'Harry789']);
// Send each user an email.
$users->each(function ($user) {
Mailer::sendWelcomeEmail($user);
});
use Enzyme\Collection\Collection;
$users = new Collection(['John123', 'Jane456', 'Harry789']);
var_dump($users[0]); // 'John123'