I have put together a very small PHP class of useful functions. It is designed only for a development environment, not in production.
A zip file containing the class and cheatsheet.php (an example page that uses JATools to display a list of defined variables, functions etc) directly from my website.
Available JATools functions:
Echos the contents of a variable between BR tags and ###’s so as to be distinguishable – good for strings/numbers.
Wraps the ouput of print_r($var) between a pair of PRE tags – good for arrays or variables of unknown type.
- writeArrayNicely($array, $depth=1, $recurse=true)
Writes out the contents of an array in graphically pleasing way – good for figuring out the structure of an array. $depth is used by the function when recursively calling itself. $recurse can be set to false to prevent the function from repeatedly calling itself – will cause only one dimension of the array to be shown.
Starts a php microtime timer – good for testing page generation times.
Echos the current time of the timer started by startTimer(). You can call this repeatedly throughout a page to find out which parts take the most time.