The WordPress admin bar, introduced in version 3.1 is cool and useful, but sometimes it gets in the way of admins and other logged in users (especially to developers, who are currently working on a website’s header).
Here is a simple PHP snippet that will get rid of the admin bar. You can bring it back by just removing these three lines.
These go in your theme’s functions.php file.
PHPAcademy provided this wonderful 2-part tutorial on how to code a short function to check if a given website is online or down currently. Similar functionality can be seen at isup.me.
PHP arrays are cool, but if you are switching to the modern coding standards (OOP) you are probably in need of objects more often.
PHP provides a very easy way to change the type of a variable from an array to an object. It’s done via typecasting.
Here’s an example:
// The actual conversion
$obj = (object) $arr;
echo $obj->name; // Will display John