What, who, where am I?!?
Craig Lotter is a web developer based in Gordon's Bay, South Africa, who seems completely incapable of shaking off that pesky inner child within, the one that forces him to love all things animated or hand drawn.
The Rugged Rock of Craig contains snippets of his life, popular culture and all the important things like anime, manga, games and comic books. The CodeUnit of Craig on the other hand contains the more serious stuff like code snippets and tutorials, while the House of C chronicles his foray into the world of web comics.
For which it never seems he has enough time anyway.
CodeUnit Post Archive
Rugged Rock Studio
Tag Archives: function
PHP: Print out all Variables passed to a Function

Of course, the easiest way of determining this is to call the function and print out what variables are coming into it, and thanks to some native PHP functions, this turns out to be quite the easy thing to do. Continue reading
Posted in Technology & Code, Tutorials
Tagged arguments, function, parameters, PHP, variables
4 Comments
PHP: Implode a Multi-dimensional Array

PHP’s implode is a pretty handy function to flatten any array into a single string value, using any piece of ‘glue’ (basically a substring) that you specifiy to put everything together. Of course, extending this function to handle multi-dimensional arrays (or matrices if you prefer) is a pretty simple matter of quickly whipping up a recursive version.
Continue reading
Posted in Technology & Code, Tutorials
Tagged array, flatten, function, implode, matrix, multi-dimension, PHP, recursion, recursive
5 Comments
Get the Last Day of a Month using PHP
Picked this cool little PHP function to calculate and return the last day of a month for any year off the always informativelutrov interactive website the other day. Continue reading
Posted in Technology & Code
Tagged calendar, function, last day, last day of the month, PHP
6 Comments
PHP: Convert a UTF-16 String to a UTF-8 String

Andrew Walker crafted this handy little PHP function which can convert a UTF-16 encoded string into a more PHP-friendly UTF-8 encoded string. Continue reading
Posted in Technology & Code
Tagged andrew walker, byte order mark, convert, function, PHP, string, utf-16, utf-8
3 Comments






