Skip to content

Instantly share code, notes, and snippets.

View dellow's full-sized avatar

Stew Dellow dellow

  • J&S Accessories
  • UK
View GitHub Profile
@dellow
dellow / in_arrayi.php
Last active August 29, 2015 14:18
Case insensitive in_array().
/**
* in_arrayi
* Case insensitive in_array().
*
* @since 1.0.0
* @version 1.0.0
**/
function in_arrayi($needle, $haystack){
return in_array(strtolower($needle), array_map('strtolower', $haystack));
}
@dellow
dellow / array_flatten.php
Last active August 29, 2015 14:18
Flattens any array.
/**
* array_flatten
* Flattens any array.
*
* @since 1.0.0
* @version 1.0.0
**/
function array_flatten($array){
$return = array();
array_walk_recursive($array, function($a) use (&$return) { $return[] = $a; });
@dellow
dellow / p.php
Last active August 29, 2015 14:18
Better print_r() for debugging purposes.
/**
* p
* Better print_r() for debugging purposes.
*
* @since 1.0.0
* @version 1.0.0
**/
function p($data){
$debug = debug_backtrace();