Flabby Rabbit | The offical home of The Rabbit

Archive for the "PHP" Category

Running a function after page execution

“Registers a callback to be executed after script execution finishes or exit() is called.” – php.net Here is a simple class to show the execution time of a page: <?php     class logger {                 private $exec_start, $exec_time;                 function [...]

Read More ›

WordPress Integration

While working on a new site I found the need to integrate wordpress into the design. I first set about looking at WP databases, but they seemed very empty and bit unorganized. So I looked into the “correct” way of doing it, and found some very interesting results, this was the code I ended up [...]

Read More ›

Loop through an array

So you want to loop through an array? The straight forward answer would be something like this: for (var i=0, i&lt;theArray.length; ++i){   … } Is there a better way? Well have a look at this: var len = theArray.length; for (var i=0, i&lt;len; ++i){   … } Can’t see the difference or the point? [...]

Read More ›

 

Essentials