PHP Array tutorial


Home - Tutorials - Basics

In this tutorial I will show you how to work with arrays in PHP. You will learn how to create, sort or print an array. Besides this we will touch on multidimensional arrays as well.

Tutorial info:


Name:PHP Array tutorial
Total steps:7
Category:Basics
Level:Beginner
Product:See complete product

Bookmark PHP Array tutorial



spacer

Step 1 - Introduction to arrays


PHP Array tutorial


Arrays are special data types. Despite of other normal variables an array can store more than one value. Let's suppose you want to store basic colors in your PHP script. You can construct a small list from them like this:

Color list:

It is quite hard, boring, and bad idea to store each color in a separate variable. It would be very nice to have the above representation almost as it is in PHP. And here comes array into play.

The array type exists exactly for such purposes. So let's see how to create an array to store our color list.





Next Step of PHP Array tutorial


Tags: array, php array, sort array, create array, print array, array length

<Back - Tutorial Index Next - Step 2> -->
PHP Array tutorial - Table of contents
Step 1 - Introduction to arrays
Step 2 - Creating an array
Step 3 - Display the array content
Step 4 - Associative arrays
Step 5 - Multidimensional arrays
Step 6 - Array functions
Step 7 - Complete example code


F1 Site Family
AJAX F1
CSS F1
Database F1
Flash F1
HTML F1
Java F1
JavaScript F1
PhotoShop F1
PHP F1
Scripts F1
Tutorial F1
Windows F1
 
spacer

Family tutorials
AJAX PHP
AJAX File Upload
AJAX Rating System
MySQL Create User
Mysqldump Example
MySQL Concat
JavaScript String
JavaScript Timeout
JavaScript Tooltip

Total time: 0.0175

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.