Jump to content

how to create multidimensional array in php


aj123cd

Recommended Posts

Multi-arrays are just ways to assign info about particular values to said value.

 

First Array

$sports = array('football', 'soccer', 'baseball');

 

Second Array

$sport['football']['stuff'] = array('stuff', 'to', 'go', 'in', 'this', 'array');

// or foreach
foreach($sports as $sport):
$sport['stuff'] = array('stuff', 'to', 'go', 'in', 'this', 'array');
endforeach;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.