benjaminbeazy Posted February 17, 2007 Share Posted February 17, 2007 i've got an idea for a class that templates a search page with filters and results that can be called with just a couple arrays and queries but is it possible to put an array within an array and is it possible to pass such an array to a function??? Link to comment https://forums.phpfreaks.com/topic/38893-array-within-array-to-function/ Share on other sites More sharing options...
hvle Posted February 17, 2007 Share Posted February 17, 2007 yes, PHP supports multi-dimensional array. $multiArray = array ('fruit'=> array('apple', 'banana'), 'veggie'=> array('lectuce', 'salad')); now $multiArray['fruit'] is an array contain 'apple' and 'banana'. $multiArray['veggie'] is an array contains 'lectuce' and 'salad' You can also pass this $multiArray as an argument of a function like: myfunc($multiArray); Link to comment https://forums.phpfreaks.com/topic/38893-array-within-array-to-function/#findComment-187030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.