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
| function __autoload($class) | |
| { | |
| if (strpos($class, 'CI_') !== 0) | |
| { | |
| if (file_exists($file = APPPATH . 'core/' . $class . EXT)) | |
| { | |
| include $file; | |
| } | |
| elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT)) | |
| { |
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 | |
| $array = array('hi' => 'a', 'yo' => 'b'); | |
| array_walk($array, function(&$value, $key){ | |
| $value = strpos('abcdefghijklmnopqrstuvwxyz', $value) + 1; | |
| }); | |
| print_r($array); // Array ( [hi] => 1 [yo] => 2 ) | |
| // < PHP 5.3 | |
| function alphanum(&$value, $key){ |
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
| <snippet> | |
| <content><![CDATA[ | |
| <div class="clearfix"> | |
| <label for="$1">$2</label> | |
| <div class="input"> | |
| <?=form_input('$1', set_value('$1'), 'id="$1"')?> | |
| </div> | |
| </div> | |
| ]]></content> | |
| <tabTrigger>formtext</tabTrigger> |
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
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| #Removes access to the system folder by users. | |
| #Additionally this will allow you to create a System.php controller, | |
| #previously this would not have been possible. | |
| #'system' can be replaced if you have renamed your system folder. | |
| RewriteCond %{REQUEST_URI} ^system.* | |
| RewriteRule ^(.*)$ /index.php?/$1 [L] | |
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 | |
| if ( ! function_exists('time_ago')) | |
| { | |
| function time_ago($time, $max_units = NULL) | |
| { | |
| $lengths = array(1, 60, 3600, 86400, 604800, 2630880, 31570560, 315705600); | |
| $units = array('second', 'minute', 'hour', 'day', 'week', 'month', 'year', 'decade'); | |
| $unit_string_array = array(); | |