Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP Array - Visualizing the Array
<?php
namespace KnowTheCode;
$main_st_homes = array(
1058 => array(
'floor1' => array(
100 => array(
'name' => 'Smith',
),
101 => array(
'name' => 'Thompson',
),
),
'floor2' => array(
200 => array(
'name' => '',
),
201 => array(
'name' => 'Nebs',
),
202 => array(
'name' => 'Jacobson',
),
),
'floor3' => array(
300 => array(
'name' => 'Reynolds',
),
301 => array(
'name' => '',
),
302 => array(
'name' => 'Tonya',
),
),
'floor4' => array(
400 => array(
'name' => 'Ballor',
),
402 => array(
'name' => 'Crest',
),
),
'floor5' => array(
500 => array(
'name' => 'Miller',
),
),
),
);
ddd( $main_st_homes[1058]['floor3'][302]['name'] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment