[ 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
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.