Update README because I forgot how to develop this app.
[Marketplaylister.git] / mpfuncs.php
CommitLineData
86b8d9ed
JC
1<?php
2
3const DATE_FORM = 'mdY';
4
5function findChildWithClass(/** iterable */ $children, string $class)/**: array*/ {
6 if ($children instanceof Traversable) {
7 $children = iterator_to_array($children);
8 }
9 return array_filter(
10 $children,
11 function($child) use ($class) {
12 return $child->hasAttributes()
13 && $child->attributes->getNamedItem('class')->value == $class;
14 }
15 );
16}