I know they say it’s not a bug, but the other day I was using class_exists() and the spl_autoload() functions to load my libraries. I discovered that class_exists() automatically returns an Exception when the class indeed does not exist! This was a problem, since I had created a custom exception MyException.
Tag Archive: php
Sep
04
Use a PHP class to connect to a database
Often times I’ve found myself wanting a quick and easy way to set up a connection to a MySQL database in PHP. In procedural code this was often accomplished by adding a few lines of code atop the first PHP file in the program. I’ve decided to write an object that uses the constructor to …
Aug
25
Create a PHP Object
Object oriented programming was a foreign concept when I first started with it. I grew up writing procedural code all the way back to when I was 6 and coding in BASIC on my Atari 400! Procedural code was the way, but no longer. I am all about OOP now that I’ve grasped the basics …
Jul
14
The image … cannot be displayed because it contains an error.
I’ve been working in PHP with images and trying to get the GD and ImageMagick tools to work with my Windows 7-based PHP dev machine. My production servers are all LINUX because, let’s face it, who has time to reboot Windows that many times a day! But at home I’ve got a Windows PC that …