- array child in php [closed]
- $mychild = $list[1]['children'];
- Array
- (
- [0] => Array
- (
- [id] => 7
- [children] => Array
- (
- [0] => Array
- (
- [id] => 9
- )
- )
- )
- [1] => Array
- (
- [id] => 6
- )
- [2] => Array
- (
- [id] => 8
- )
- [3] => Array
- (
- [id] => 10
- )
- )
- isset($list[1]['children'])
- array_key_exists('children', $list[1])
- if (isset($list[1]) && isset($list[1]['children']))
- {
- // code here!
- }