Parsing an HTML Table with PEAR’s XML_HTMLSax3

Here’s an example of how to parse an HTML table into an array using the PEAR module XML_HTMLSax3. It supports the , and elements and the rowspan and colspan attributes. It’s worth noting that this code will raise a bunch of notices if you run it displaying all errors. This is pretty difficult to avoid, … Continued

PHP Domain Class

On Usenet an often-asked question is how to programmatically determine the “domain” of a particular hostname. That is, excluding the components traditionally thought of as subdomains. As an example, groups.google.com and www.google.com both have a domain of google.com. Invariably, one answer comes back stating that you just need to chop off everything from the front, … Continued

On The Legibility of PHP

David Segall wrote: I do not deny that the programmer is the most significant factor in the readability of a program but would you really promote PHP as a language because it is easy to read? I certainly wouldn’t advise against it because of legibility concerns. Any language that supports comments (not all do) and … Continued