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
| <html> | |
| <body> | |
| <p>Here are Webber’s points:</p> | |
| <ul> | |
| <li>If a method can be static, declare it static. Speed improvement is by a factor of 4.</li> | |
| <li>echo is faster than print.(<em>* compare with list from phplens by John Lim</em>)</li> | |
| <li>Use echo’s multiple parameters instead of string concatenation.</li> | |
| <li>Set the maxvalue for your for-loops before and not in the loop.</li> | |
| <li>Unset your variables to free memory, especially large arrays.</li> | |
| <li>Avoid magic like __get, __set, __autoload</li> |
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
| <? | |
| /** | |
| Calculates the percentage change between two numbers. | |
| Useful for showing how much traffic has changed from one time period to the next. | |
| */ | |
| $percentChange = function ($cur, $prev) { |
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 | |
| /* | |
| * XSS filter, recursively handles HTML tags & UTF encoding | |
| * Optionally handles base64 encoding | |
| * | |
| * ***DEPRECATION RECOMMENDED*** Not updated or maintained since 2011 | |
| * A MAINTAINED & BETTER ALTERNATIVE => kses | |
| * https://github.com/RichardVasquez/kses/ | |
| * | |
| * This was built from numerous sources |
NewerOlder