[ create a new paste ] login | about

Link: http://codepad.org/SQmQQbIP    [ raw code | output | fork ]

PHP, pasted on Jul 1:
<?php
$array = array(
	'1' => array(
		'name' => '勉強',
		'child' => array(
			'2' => array(
				'name' => '国語',
				'child' => array(
					'3' => array('name' => '読書'),
					'4' => array('name' => '作文'),
				),
			),
		),
	),
	'5' => array('name' => '遊び')
);

//勉強は国語
echo $array['1']['name'] . 'は' . $array['1']['child']['2']['name'];

//勉強は国語で読書
echo $array['1']['name'] . 'は' . $array['1']['child']['2']['name'] . 'で' . $array['1']['child']['2']['child']['3']['name'];
?>


Output:
1
勉強は国語勉強は国語で読書


Create a new paste based on this one


Comments: