Category Archives: Php Freaks

ArrayObject PHP Class Examples

As one of the building blocks of the Standard PHP Library (SPL), the ArrayObject class is a traversable, countable structure, which allows you to treat objects as arrays. This functionality seems irrelevant at first sight, but the class may be a real time-saver in certain situations. That’s especially true when...

File Security and Resources with PHP

File Ownership and Permissions These days, security is paramount to any server installation, large or small. Most modern operating systems have embraced the concept of the separation of file rights via a user/group ownership paradigm, which, when properly configured, offers a wonderfully convenient and powerful means for securing data. In...

Handling File Data with PHP

Reading from a File PHP offers numerous methods for reading data from a file, ranging from reading in just one character at a time to reading in the entire file with a single operation. Many of the most useful functions are introduced in this section. file() array file (string filename...

Executing Shell Commands with PHP

Writing to a File This section highlights several of the functions used to output data to a file. fwrite() int fwrite (resource handle, string string [, int length]) The fwrite() function outputs the contents of string to the resource pointed to by handle. If the optional length parameter is provided,...

Developing HTML Emails

“Email clients over the past few years really haven’t kept up with the pace of today’s developers. When developing emails, it feels like you’ve stepped back into the late 90′s, writing out-dated code. Below are some tips & tricks I’ve found helpful over the past few years of developing emails….”...

Support the fixing of the XDebug profiler!

If you read my recent tutorial on the use of the excellent XDebug profiler, you may be aware of what a truly a great FOSS PHP extension it is, used by countless developers over the years. Unfortunately the cachegrind format is not quite right, because when XDebug was developed Derick...