PHP 5 for Dummies Free Open Book

PHP 5 for Dummies

Previous PageNext Page
Chapter 6
Storing Data in Groups 
by Using Arrays
In This Chapter
Building arrays
Assigning values to arrays
Sorting arrays
Using values in arrays
Building multidimensional arrays
A
rraysare complex variables that store a group of values under a single
variable name. An array is useful for storing a group of related values.
For example, you can store information about a car, such as model, color, and
cost, in a single array named 
$FordInfo
. Information in an array can be han-
dled, accessed, and modified easily. For example, PHP has several methods
for sorting the information inside an array.
In this chapter, you find out how to create, modify, copy, and use arrays.
Creating and Working with Arrays
Arrays are an important feature in PHP programming. This section describes
how to create, modify, and remove arrays.
Creating arrays
To create a variable, you assign a value to it. Similarly, the simplest way to
create an array is to assign a value to it. For instance, assuming that you have
not referenced 
$customers
at any earlier point in the script, the following
statement creates an array called 
$customers
:
Previous PageNext Page


     Main Menu
PHP 5 for Dummies
Table of Contents
Introduction
Part I: Say Hello to the PHP Scripting Language
Part II: Variables and Data
Documenting the Script - Page 68
Documenting the Script - Page 69
Chapter 4: Using Variables in PHP Scripts
Chapter 5: Working with Data
Chapter 6: Storing Data in Groups by Using Arrays
Sorting Arrays
Using Arrays in Statements
Walking through an Array
Finding Array Size
Converting Variables into Arrays (And Vice Versa)
Splitting and Merging Arrays
Comparing Arrays
Working with Other Array Operations
Multidimensional Arrays
Built-in PHP Arrays
Part III: Basic PHP Programming
Part IV: Common PHP Applications
Part V: The Part of Tens
Part VI: Appendixes
Index
Team DDU


More Books
PHP Hacks
Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
The Koran (Holy Qur'an)
Macromedia Flash 8 Bible
Search Engine Optimization for Dummies
YouTube Traffic
PHP 5 for Dummies
Harry Potter and The Chamber of Secrets
Harry Potter and the Sorcerer's Stone
The Pilgrim's Progress
Wireless Hacks
Flash Hacks. 100 Industrial-Strength Tips & Tools
PayPal Hacks. 100 Industrial-Strength Tips and Tools
Amazon Hacks
Pdf Hacks
The Da Vinci Code
Google Hacks
The Holy Bible
Windows XP For Dummies
Harry Potter and the Half-Blood Prince
Seo Book
Upgrading and Repairing Networks
Macromedia Dreamweaver 8 UNLEASHED
Windows XP Annoyances
Windows XP Hacks
Microsoft Windows XP Power Toolkit
Teach Yourself MS Office In 24Hours
iPod & iTunes Missing Manual
PC Hacks 100 Industrial-Strength Tips and Tools
PC Overclocking, Optimization, and Tuning - 2th Edition
PC Hardware In A Nutshell 3rd Edition
PC Hardware in a Nutshell, 2nd Edition
Upgrading and Repairing PCs
Google for Dummies
MySQL Cookbook
Teach Yourself Macromedia Flash 8 In 24 Hours
PHP CookBook
Sams Teach Yourself JavaScript in 24 Hours
PHP5 Manual
Free Games Paper Airplanes
500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele