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 | |
| /** RESULTS: Closures and str_repeat() | |
| php /var/www/BBC/Test.php | |
| Test started | |
| 0 || 263152 | |
| 1000 || 485437312 | |
| 2000 || 970686632 | |
| 3000 || 1458032936 |
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 | |
| function instr($string, $substr, $offset = 0, $length = -1) | |
| { | |
| $pos = (int) $offset; | |
| $substr_pos = 0; | |
| for (; $pos !== $length; $pos++, $substr_pos++) | |
| { |
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
| vagrantfile: | |
| target: local | |
| vm: | |
| box: puphpet/ubuntu1404-x64 | |
| box_url: puphpet/ubuntu1404-x64 | |
| hostname: 56.php.vm | |
| memory: '512' | |
| cpus: '1' | |
| chosen_provider: virtualbox | |
| network: |
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 | |
| /** | |
| * Microsoft uses their own character set Code Page 1252 (CP1252), which is a | |
| * superset of ISO 8859-1, defining several characters between DEC 128 and 159 | |
| * that are not normally displayable. This converts the popular ones that | |
| * appear from a cut and paste from windows. | |
| * | |
| * @param string|false $string | |
| * @return string $string |
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 | |
| function pc_next_permutation($p, $size) | |
| { | |
| // slide down the array looking for where we're smaller than the next guy | |
| for ($i = $size - 1; $p[$i] >= $p[$i + 1]; --$i); | |
| // if this doesn't occur, we've finished our permutations | |
| // the array is reversed: (1, 2, 3, 4) => (4, 3, 2, 1) | |
| if ($i == -1) |
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 | |
| function getIPBanRange(array $start, array $end) | |
| { | |
| $parts_count = count($start); | |
| if ($parts_count !== count($end)) | |
| { | |
| throw new \InvalidArgumentException('$start and $end must be the same length'); | |
| } |
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 | |
| function gist_bbc(&$codes, &$no_autolink_tags, &$itemcodes) | |
| { | |
| $codes[] = array( | |
| 'tag' => 'gist', | |
| 'type' => 'unparsed_content', | |
| 'content' => '<script src="$1.js"></script>', | |
| 'validate' => function(&$tag, &$data, $disabled) { | |
| $data = strtr($data, array('<br />' => '')); |
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 | |
| /** | |
| * The job of this file is to handle everything related to posting replies, | |
| * new topics, quotes, and modifications to existing posts. It also handles | |
| * quoting posts by way of javascript. | |
| * | |
| * @name ElkArte Forum | |
| * @copyright ElkArte Forum contributors | |
| * @license BSD http://opensource.org/licenses/BSD-3-Clause |
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 | |
| function getBoardTree() | |
| { | |
| global $cat_tree, $boards, $boardList; | |
| $db = database(); | |
| // Getting all the board and category information you'd ever wanted. | |
| $request = $db->query('', ' | |
| SELECT | |
| IFNULL(b.id_board, 0) AS id_board, b.id_parent, b.name AS board_name, b.description, b.child_level, |