Skip to content

Instantly share code, notes, and snippets.

View beingzoe's full-sized avatar

zoe somebody beingzoe

View GitHub Profile
@beingzoe
beingzoe / Remove values from array...elegantly
Created January 26, 2011 09:32
If you need to remove elements from an array that have a particular value(s) here’s a neat way of doing it without any looping.
<?php
// PHP: Remove Values from Array
// If you need to remove elements from an array that have a particular value(s) here’s a neat way of doing it without any looping.
// our initial array
$arr = Array("blue", "green", "red", "yellow", "green", "orange", "yellow", "indigo", "red");
print_r($arr);
// remove the elements who's values are yellow or red
protected static $_known_appliances;
// Registers a loadable class
public function registerToLoad($library, $path, $class_name = FALSE) {
$_known_appliances[$library]['path'] = $path;
$_known_appliances[$library]['class_name'] = $class_name; // FALSE if appliance is not a class
}
class CI_Base {
private static $instance;
public function CI_Base()
{
self::$instance =& $this;
}
public static function &get_instance()