This file contains 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 | |
define('ROOT', $_SERVER['DOCUMENT_ROOT']); | |
class AutoLoader { | |
private static $possible = array(); | |
private static $events = array(); | |
public static function load($class){ |
This file contains 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 | |
function parseClasses($classes){ | |
return explode(' ', preg_replace('/[\t\s]+/',' ', trim($classes))); | |
} | |
function addBodyClass($class){ | |
global $APPLICATION; | |
$classes = parseClasses($APPLICATION->GetPageProperty('body_class')); | |
$add = parseClasses($class); |
This file contains 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 | |
$source = [ | |
'color' => ['red','blue','white','yellow','black'], | |
'who' => ['rabbit','bear','wolf'], | |
'else' => ['in space','in Russia','is hungry','is dead'] | |
]; | |
var_dump(recursion_calculate($source)); |
This file contains 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 | |
/** | |
* Validates a credit card number using an array of approved card types. | |
* | |
* @param $number | |
* The credit card number to validate. | |
* @param $card_types | |
* An array of credit card types containing any of the keys from the array | |
* returned by commerce_payment_credit_card_types(). Only numbers determined |
NewerOlder