Archive for January 18th, 2007

PHPBuilder.com: Dynamic XML with PHP

PHPBuilder.com as posted a new tutorial that deals with combining the power of PHP and the flexibility of XML to create a simple, easy-to-use class for creating dynamic XML documents.

In this article I will show how to generate dynamic XML documents with Object-Oriented PHP. […] So, in simplicity, instead of outputting our XML by handcoded column names, we are going to create a method that dynamically creates XML output with only a record id and the table name to query from. The implementation, however, is a bit more complex.

They start at the end (to know where they’re headed) and work backwards to create functions to output the XML, get the items from the database, and set the values to the XML. The end result is a simple XML output that, based on field names from the database, organizes the database output.

Continue Reading · Add comment

PHP Application Design Part 1: OOP In Full Effect

Ready to start building extensible applications?

Continue Reading · Add comment

Michi Kono’s Blog: The Best PHP Book Out There

Michi Kono has posted a new book review of one of the popular PHP-related offerings from Sams Publishing - “Advances PHP Programming” by George Schlossnagle.

Only one stands out in my mind as truly exceptional: Advanced PHP Programming. I am willing to bet this is the best book out there for novice to advanced PHP developers. It is not the best beginner book as it has some advanced topics (as the title suggests), but the material it covers is seldom mentioned in any detail in other books.

He talks about it as a resource for programmers looking for moving to that next level and how useful it was to him (and could be to other developers) with helpful hints and more refined methods. There’s a brief look at some of the contents - session management, security, database abstraction - and his opinions on them.

The book was the single greatest investment I ever made in my PHP skills. I’ve recommended this book to every novice PHP developer I’ve ever met.

Continue Reading · Add comment

HowTo Forge: PHP Programming Basics

The HowTo Forge website has posted the first part in a new series of tutorials to help people (programmers and non) to get into PHP and be comfortable working with it.

This first part starts from the base they’ve already set (installation/configuration) and actually gets into the code.

This article is the first of a series of PHP guides that aim at teaching you the basics of PHP programming. By now, I hope you would have set up your system to start actual PHP programming. Lets start PHP programming.

They keep things simple and look at topics like:

  • What are tags?
  • Web Page Parsing
  • Operators and Operands
  • Variables

Continue Reading · Add comment

IBM developerWorks: Convert XML to JSON in PHP

In this new post on the Zend Developer Zone today, Cal Evans shares a link to an interesting article over on the IBM developerWorks website. It deals with converting XML to JSON using PHP.

With the growing popularity of Web 2.0, a new data interchange format called JavaScript Object Notation (JSON) is emerging as a useful way to represent data in the business logic running on browsers. Learn how PHP-based server programs can convert XML-formatted enterprise application data into JSON format before sending it to browser applications.

The article starts with the basics, XML and JSON, then moves quickly on to other topics like “browser-side data processing” and “xml-to-json conversion”. From there, it’s all about the code - creating the xml2json script to make the transition simple. It incorporates the Services_JSON package to help with the handling.

The entire code is laid out in one block, making it simple to cut & paste and mess with a bit. They even include a sample of its usage as a command line script, complete with sample input and the resulting output.

Continue Reading · Add comment