This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CI_Base { | |
private static $instance; | |
public function CI_Base() | |
{ | |
self::$instance =& $this; | |
} | |
public static function &get_instance() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |