News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

MSBWare.com:
XML to Array
0 comments :: posted Monday April 14, 2008 @ 10:23:11
voice your opinion now!

Michael has posted a simple script today that takes in XML data and spits back out an array on the other side:

The function takes the specified XML data (which must be in valid XML format) and converts into an array. Any attributes in the XML elements are dropped an only the element values are placed in the array.

The code uses a combination of XPath, DOM, and regular expressions to parse the given XML content.

tagged with: xml translate array xpath dom regularexpression data element


SitePoint WebTech Blog:
Give Your Visitors a Rough Time
0 comments :: posted Thursday March 06, 2008 @ 08:44:00
voice your opinion now!

In a new post to the Web Tech blog over on SitePoint, Toby Somerville has posted something he calls "RoughTime" - his method for displaying a more "human friendly" output of a timestamp.

When asked the time, we generally don't need to be military accurate with our response [...] we generally communicate the approximate time. i.e. 'its nearly ten' or 'its just gone half past three'. Yet on the web, time is generally shown as '12:24:13 AM', or similar â€" not very visitor friendly.

His RoughTime uses two switch statements to map the hour and minute values to different strings. For example, minutes between 15 and 20 become "quarter past" and the hours are changed over from numeric versions to their word counterparts.

tagged with: roughtime switch approximate time hour minute translate


book code zendframework application pecl conference PHP5 developer job mysql package security releases cakephp PEAR database release framework zend ajax

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework