Software Development

How to use the PHP Countable Interface

Background This article demonstrates how to implement and use the Countable interface in PHP. The Countable interface is normally used in conjunction with other interfaces (i.e., Iterator, ArrayAccess, etc.) to create data structures like PHP SPL Library’s SplDoublyLinkedList and SplStack.

Software Development

Constructors in PHP 5+

This article demonstrates how constructors work in PHP. It will also touch on destructors just briefly. If you’re a Java programmer who has somehow become bored with anything Java and wanted to explore PHP, the first thing you need to realize is OOP in PHP is slightly different. Take for instance, constructors.

Software Development

Return class’ Canonical Name in PHP

Background [wp_ad_camp_1] There are times you need to refer to a class by a string representing its fully qualified class name. For example in Laravel 4.2, you may specify a route to a controller by hard-coding the fully qualified class

Software Development

How to read XML Document using the XML Parser extension in PHP

With XML Parser, you use callback functions to deal with specific events such as when the start or end of an XML element is encountered. These functions are registered using API functions made available for the XML Parser extension and are triggered or executed when a specific event is encountered. Also, you can only read XML with this extension.