CancelImage Upload

Topics: PHP Array Manipulation Functions
Read our latest entries.
Posted by Garren Harland on September 23, 2009, 1:49 pm.
Throughout your PHP programming career you will no doubt at some point (or rather at many frequent points) require a function to return the size of a given array. Here then is a code example making use of just such a function.
Click here to read on.
Posted by Garren Harland on August 19, 2009, 4:23 pm.
To transfer all elements of an array into one string the function implode() is required. Simple specify the array that is to be imploded along with a separator.
Click here to read on.
Posted by Garren Harland on August 3, 2009, 4:10 pm.
If you have a large dynamically generated array, you might need a function to find out if a specific element is contained within it. And the function that would come to your rescue in this scenario is in_array().
Click here to read on.
Posted by Garren Harland on July 31, 2009, 5:39 pm.
In some instances obtaining an array's variables by themselves is not enough. Sometimes the belonging keys are also required. Here then is the easiest way to output both by using the PHP array functions list() and each().
Click here to read on.
Posted by Garren Harland on July 31, 2009, 4:38 pm.
As, the title indicates this page will discuss the PHP function split(), and how it can be used in a real world application. We will use an email invite function on a website as an example.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 3:05 pm.
Here is a very fast and efficient way of adding various html tags to every element in an array using the PHP function array_walk(). If you have not encountered the function array_walk() before now you are in for a treat. Here is how it works.
Click here to read on.
Posted by Garren Harland on July 21, 2009, 2:19 pm.
One of the quickest and simplest ways to print out an array in PHP is by using the implode() function. Although it does not give you quite as much control as you may be used to from using loops, implode is ideal for situation where only a simple list is needed.
Click here to read on.
Posted by Garren Harland on July 13, 2009, 5:47 pm.
Uploading multiple files in PHP is not very different from uploading a single file. The only adjustment being that instead of one variable containing the files details, the variable $userfile_name for instance would become an array.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 6:42 pm.
The function array_splice() serves two purposes. On the one hand it can be used to remove certain elements from an array. Let us say for example we have an array that consists of 20 elements, using array_splice we could remove elements 10-15, turning our array into a 15 element array. Here is how it is done.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 4:16 pm.
There are two functions that can be used in PHP to return the number of elements contained in an Array.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 3:47 pm.
For this often required functionality PHP has two predefined functions to offer.
Click here to read on.
Posted by Garren Harland on July 12, 2009, 1:12 pm.
What better way to introduce the shuffle() an array function in PHP than using a stack of cards as an example? Like a good croupier however we won't just shuffle our cards using one method. Instead we will use a batch of functions including shuffle(), array_flip(), array_reverse(), array_slice() and array_merge().
Click here to read on.
Everyday English GmbH • 8105 Regensdorf, Switzerland • Tel: +41 (0)44 840 03 68 • www.mydesigntool.cominfo@mydesigntool.com