 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Brian Moon's Blog: Stupid PHP Tricks Normalizing SimpleXML Data
by Chris Cornutt June 03, 2008 @ 09:34:22
Brian Moon has a "stupid PHP trick" posted to his blog today - normalizing SimpleXML data you've pulled in from just about any external source.
Anyhow, one annoying thing about SimpleXML has to do with caching. When using web services, we often cache the contents we get back. We were having a problem where we would get an error about a SimpleXML node not existing.
They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.
voice your opinion now!
trick stupid simplexml normalize json recursive empty tag
IBM developerWorks: Process and integrate Google Notebook data with PHP
by Chris Cornutt May 27, 2008 @ 12:05:23
A new tutorial over on the IBM developerWorks site (from Vikram Vaswani) shows how to pull data from the Google Notebook service into your script via the service's REST API.
Google Notebook is a free service that allows users to save and share notes and Web clippings in an online journal. A REST-based API allows developers to build customized PHP applications around this service using SimpleXML. In this article, you learn how to use the API, with examples of reading notebooks and notebook contents using PHP.
His method grabs the contents of the REST request and drops them into a SimpleXML object for easy manipulation. Different kinds of requests are included - getting the list of notebooks, getting the notebook's contents and how to add on extra parameters to the REST call to get more information in the responses.
voice your opinion now!
tutorial google notebook rest simplexml api
ThinkPHP Blog: Accessing Nike+ data with PHP
by Chris Cornutt May 15, 2008 @ 10:26:40
On the ThinkPHP blog today, Stephanie Ehrling has posted about a method for PHP to take in the output of the Nike+ equipment and put it into a usable form.
There is no official API that allows you to use the raw data. Nevertheless the data are sent to the Flash via XML so there is a chance to use them. For PHP Rasmus Lerdorf himself has implemented a class to access these data. The class allows to authenticate a user and fetch the running data of a user in a XML-Format
She gives an example of it in action - simple creation of an object then a call with the username and password. Behind the scenes, the data is pulled in and dropped into a SimpleXML object that includes total distance, total calories burned and data on the most recent run.
voice your opinion now!
nikeplus data xml simplexml class resmuslerdorf
Marco Tabini's Blog: 5 PHP 5 features you can't afford to ignore
by Chris Cornutt April 29, 2008 @ 17:06:45
Marco Tabini has posted his list of what he considers five features of PHP5 that you "can't afford to ignore" when doing your development work:
Despite the fact that you may not have a choice in the matter, upgrading comes with a number of bonus new features that can help you write better code and gain access to new functionality that required a fair amount of hacking in previous version. Here's a quick list of 5 personal favourites.
The feature to make his list are SimpleXML, JSON/SOAP, PDO, the Standard PHP Library and SQLite. Each has their own bonus feature(s) included too for a little extra incentive to check them out.
voice your opinion now!
php5 feature list ignore simplexml json soap pdo spl sqlite
WebReference.com: XML-Enabled Applications
by Chris Cornutt September 17, 2007 @ 10:24:00
WebReference.com has an excerpt posted from one of Packt Publishing's latest PHP-related offerings, "PHP Oracle Web Development: Data processing, Security, Caching, XML, Web Services, and Ajax" (by Yuli Vasiliev). This specific chapter talks about XML-enabled applications and how PHP fits into the mix.
Both PHP and Oracle provide comprehensive support for XML and XML-related technologies. Practically, this means you can perform any XML processing either with PHP or inside an Oracle database. [...] This chapter explains how to effectively use XML techniques and technologies available in PHP and Oracle when building XML-enabled PHP/Oracle applications.
They cover the processing of XML in PHP/Oracle apps (including the SAX, DOM and SimpleXML methods), working with XPath and processing the XML in the other half of the two - Oracle's XML processing functionality.
Check out the Packt website for more information on the book.
voice your opinion now!
xml application oracle process simplexml dom sax xml application oracle process simplexml dom sax
|
Community Events
Don't see your event here? Let us know!
|