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


Matthew Weir O'Phinney's Blog:
Zend_Form Advanced Features
0 comments :: posted Tuesday April 08, 2008 @ 12:13:35
voice your opinion now!

Matthew Weir O'Phinney has written up a post for his blog outlining some of the other cool little features that were included in the recent release of the Zend Framework, specifically with the Zend_Form component.

I've been working on for the past few weeks, and it's nearing release readiness. There are a number of features that Cal didn't cover in his DevZone coverage (in part because some of them weren't yet complete) that I'd like to showcase.

These additional features Matthew mentions are:

  • Internationalization
  • Element Grouping
  • Array Support

Check out more of the great features of the component in the Zend Framework documentation.

tagged with: zendform advanced feature internationalization grouping array

Eirik Hoem's Blog:
Array problems with SOAP and PHP - Updated
0 comments :: posted Thursday March 13, 2008 @ 10:22:19
voice your opinion now!

Eirik Hoem has posted an update on a previous problem he was having when working with SOAP in PHP and its handling of arrays.

The scenario was that when an array with only one object was returned over SOAP the array was discarded and pointed straight to the single object.

Come to find out, this behavior wasn't a bug, it was a feature - the fix is to add another parameter to the initialization of the SoapClient to add the SOAP_SINGLE_ELEMENT_ARRAYS feature.

tagged with: soap gotcha array problem soapsingleelementarrays feature bug

phpRiot.com:
Using the PHP 5 Iterator interface with Smarty
0 comments :: posted Monday March 10, 2008 @ 09:35:00
voice your opinion now!

On the phpRiot blog, Quentin Zervaas has posted a quick tutorial about using the Iterator interface (part of the Standard PHP Library) together with Smarty to loop through some objects:

The PHP 5 Iterator interface is very useful for defining custom behaviour for looping over objects, however I just noticed that looping over such objects in Smarty will not work correctly. Smarty will in fact cast an object back to an array.

He includes code examples of his problem to illustrate and shows how he got around the problem - a getData() function he defined that just returns the array from the object.

tagged with: iterator interface smarty php5 spl object array

Michael Kimsal's Blog:
Grails for PHP Developers Part 5
0 comments :: posted Tuesday February 19, 2008 @ 12:02:00
voice your opinion now!

Michael Kimsal points out the posting of the latest part of his "Grails for PHP developers" series to his blog site - Part Five of the series.

I've put up the latest installment in my "Grails for PHP developers". Rather than delve too much more in to Grails head on, I'm taking this installment (and at least the next one) to delve more in to the Groovy language itself. Groovy offers similarities to PHP, but also many differences which can trip you up if you're not careful. I'll try to lay those out as best I can in the next couple of installments.

This new part of the series goes back and puts the spotlight on GRoovy, the base of the Groovy/Grails combo. He talks about working with variables and arrays as containers for multiple pieces of data and some possible gotchas that could come up along the way.

tagged with: grails developer groovy array variable store screenshot

Hasin Hayder's Blog:
Unexpected return value from Facebook FQL.query via PHP REST Lib
0 comments :: posted Monday February 18, 2008 @ 12:06:00
voice your opinion now!

Hasin Hayder had been working with the Facebook API and stumbled across a bug in an application they had created for the social networking site:

The method which we used to count number of friends of a specific user who has added that application was returning 1 when there is no friend actually installed it.

He gives the SQL query and the PHP code he was originally using to find out the number of users for the application. The problem came from the fact that the returning value wasn't an array - it was a string. The corrected code (that checks for array-ness) is also included.

tagged with: facebook query rest library return value array string

Matthew Weir O'Phinney's Blog:
Zend_Form Advanced Features
0 comments :: posted Monday February 11, 2008 @ 13:54:00
voice your opinion now!

In a new post to his blog today, Matthew Weir O'Phinney dives in to some of the more advanced features that the Zend_Form component of the Zend Framework has to offer.

I've been working on for the past few weeks, and it's nearing release readiness. There are a number of features that Cal didn't cover in his DevZone coverage (in part because some of them weren't yet complete) that I'd like to showcase.

These additional features include internationalization, element grouping and array support. He looks at each of these, including some sample code where needed, and shows you how they can be useful to you and your ZF application.

tagged with: zendform zendframework advanced feature international grouping array support

Make Me Pulse Blog:
Tips RecursiveArrayIterator on mulitdimensional Array
0 comments :: posted Monday February 11, 2008 @ 13:07:00
voice your opinion now!

On the Make Me Pulse blog, Antoine Ughetto shares a method he came up with to recurse through an array using the SPL method - the RecursiveArrayIterator method.

When we have a multidimensional array we have to make some recursives function to parse it. A simple way to get the keys and the value of this type of array is to use the SPL library of PHP.

A code example is included, parsing through a recursive array to output each of the key/value pairs it contains (and using only about five or six lines of code to do it).

tagged with: spl library standard recursiveiteratoriterator multidimensional array

Maarten Balliauw's Blog:
LINQ for PHP (Language Integrated Query for PHP)
0 comments :: posted Thursday January 24, 2008 @ 08:45:00
voice your opinion now!

Maarten Balliauw has posted about an interesting new development he's made and is sharing with the PHP community - PHPLinq (Language Integrated Query).

Perhaps you have already heard of C# 3.5's "LINQ" component. LINQ, or Language Integrated Query, is a component inside the .NET framework which enables you to perform queries on a variety of data sources like arrays, XML, SQL server, ... These queries are defined using a syntax which is very similar to SQL. [...] I thought of creating a similar concept for PHP. So here's the result of a few days coding.

The library is available for download and some examples are included to show it in action (both in a simple example and in a more complex search on a series of objects).

tagged with: linq array object search query language phplinq library

PHPWACT.org:
Handling UTF-8 with PHP
0 comments :: posted Thursday January 24, 2008 @ 07:51:00
voice your opinion now!

Ed Finkler has pointed out a handy resource for those trying to cope with using the UTF-8 support included in several of PHP's functions - this page on the Web Application Component Toolkit wiki.

This page is intended as a reference for functionality PHP provides which can either help with handling UTF-8 or should be regarded as a risk when used in conjunction with UTF-8 encoded strings. Further information can be found on the Internationalization (I18N) and Character Sets / Character Encoding Issues pages.

It talks about the "dangerous" functionality PHP has (issues that the language has in current functions) when using things like the PCRE extension, the string extension, the array methods, handling variables, the XML extensions (DOM and SAX), image manipulation, and URL parsing functionality.

tagged with: utf8 dangerous functionality pcre xml string array image url


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

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