dcsimg

Two-Dimensional Arrays In PHP

By Kevin Reichard (Send Email)
Posted Jun 22, 2000


[ Thanks to Tre Harmon for this link. ] This Scriptlet goes over a nice way of creating and returning a 2 dimensional array in PHP.

This Scriptlet goes over a nice way of creating and returning a 2 dimensional array in PHP...


Excerpt:


/*
Scenario:
You need to store info for 3 people and for each person you must have their:
Age, Gender, and Job Title.
*/

// Create 2 Dimensional Array.
= array(
"Bill" => array("21","Male","Customer Service Rep"),
"Lisa" => array("22","Female","Intranet Site Admin"),
"Tre" => array("23","Male","Mailroom Geek")
);


Scriptlet Url:
http://php.lansystems.com/index.php?archive=2d_arrays.inc

Page 1 of 1


Comment and Contribute

Your name/nickname

Your email

(Maximum characters: 1200). You have characters left.