Category
SplFastArray to speed up your PHP arrays - Etienne Kneuss
Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it’s indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size (which means no […]
Popularity: unranked [?]
Harry Roberts’ Blog: Manipulating PHP arrays with SQL
Harry Roberts has a quick post to his blog today showing a method he’s come up with to handle PHP arrays from inside of SQL statements (a port of the JsonSQL library to PHP).
Trent Richardson created a very small and simple JsonSQL library for JavaScript which allows you to run an extremely limited subset of […]
Popularity: unranked [?]
Tips : RecursiveArrayIterator on mulitdimensional Array - Antoine Ughetto
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.
To do this we will use a RecursiveArrayIterator and a RecursiveIteratorIterator
(more…)
Popularity: unranked [?]
Popularity: unranked [?]
Developer Tutorials Blog: PHP array_walk(): Run an array through a function
The Developer Tutorials blog has a quick example of how to use the array_walk function to maneuver through the array of your choosing and applying a callback method to each of its elements.
It’s a common sight: taking an array and running (well, walking) its elements through a particular function. Luckily, PHP provides a simple yet […]
Popularity: unranked [?]
Make Me Pulse Blog: Tips : RecursiveArrayIterator on mulitdimensional Array
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 […]
Popularity: unranked [?]
Array problems with SOAP and PHP - Updated - Eirik Hoem
This is a followup to my post about array problems with SOAP and PHP. The scenario was that when an array with only one object was returned over SOAP the array was discarded and pointed straiht to the single object.
Cmm was kind enough to tip me this PHP bug report, which explains that this is […]
Popularity: unranked [?]
DevShed: The Switch Statement and Arrays
DevShed continues their series looking at some of the fundamentals of working with PHP in this new tutorial posted today. It looks at one of the flow control statements the language has to offer and a very useful data structure - the switch statement and arrays.
In our last exciting adventure (back in early November), we […]
Popularity: unranked [?]
ProDevTips: Sorting 2D-arrays in PHP - anectodes and reflections
On the ProDevTips website today, there’s a new article looking at the sorting of arrays, specifically of the two- and three-dimensional sort.
One of the many problems with PHP that detractors are eager to point out is the fact that the language has thousands of global functions. Without the awesome CHM version of the PHP manual […]
Popularity: unranked [?]
Array based tree structure - Richard Heyes
This is an array based tree structure class which I wrote some moons ago. It works with PHP 4/5 and, because it doesn’t use objects, i’s faster than the object based tree I wrote. It’s also simpler to use, I think. [Download]
You can use this tree in combination with the Treemenu object which I wrote […]
Popularity: unranked [?]
Datagrid and arrays (again) - Richard Heyes
So I got bored and I’ve just added array support to the Datagrid class. You can see it in action by looking at example9.php. Instead of supplying the connection parameters and the SQL query to the static Create() method, you simply supply the array. The array should be two dimensional, like that returned by mysql_fetch_assoc(). […]
Popularity: unranked [?]