View example.php
<?php
$collection = [$obj1, $obj2, $obj3];
// Dumb way
$matches = array_reduce($collection, function ($matches, $object) {
if ($object->isMatch()) {
$matches[] = $object;
}
return $matches;
View regex.php
<?php
/*
I'm trying to validate times in a PHP application. Some of the formats
I want to allow include:
- 12am (12 hour clock)
- 1:45 pm (space optional)
- 23:59 (24 hour clock)
- 00:16
View DB_query_builder.php
/**
* Select
*
* Generates the SELECT portion of the query
*
* @param string
* @param mixed
* @return CI_DB_query_builder
*/
public function select($select = '*', $escape = NULL)
View gist:3337417
<?php
$a = array();
$max_odd = 93;
$max_even = 72;
$prefix = 'B-';
$o = -1;
$e = 0;