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 | |
// Fetch data from the database | |
function my_mod_fetch_from_db() { | |
// Remember the number of dimensions of the static cache depends | |
// on the number of parameters that this function can take. | |
$cache = &drupal_static(__FUNCTION__, array()); | |
// Static cache miss | |
if (empty($cache)) { | |
// Check persistent cache |
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 | |
ini_set('memory_limit', '256M'); | |
$maximum = 1000000; // a million if you were wondering.. | |
global $values; | |
function check_if_circular($prime) { | |
global $values; | |
$back2back = $prime . $prime; // 7373 | |
$count = strlen($prime); | |
for($i = 0; $i <= $count - 1; ++$i) { |