PHP code example of sharkzt / collections
1. Go to this page and download the library: Download sharkzt/collections 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/ */
sharkzt / collections example snippets
php
if ($user->articles->contains($singleArticle)) {
$user->articles->remove($singleArticle);
}
foreach ($user->articles as $article) {
if ($article->getContent() === 'qux') {
$article->setTitle('foo');
break;
}
}