$mang = array(
'0' => array(
'uid' => 2,
'introducer_uid' => 1,
'introducer_users' => array(
'0' => array(
'uid' => 8,
'introducer_uid' => 2,
'introducer_users' => array()
),
'1' => array(
'uid' => 9,
'introducer_uid' => 2,
'introducer_users' => array())
)
),
'1' => array(
'uid' => 3,
'introducer_uid' => 1,
'introducer_users' => array(
'0' => array(
'uid' => 5,
'introducer_uid' => 3,
'introducer_users' => array()
),
'1' => array(
'uid' => 6,
'introducer_uid' => 3,
'introducer_users' => array()
),
'2' => array(
'uid' => 7,
'introducer_uid' => 3,
'introducer_users' => array(
'0' => array(
'uid' => 10,
'introducer_uid' => 7,
'introducer_users' => array(
'0' => array(
'uid' => 11,
'introducer_uid' => 10,
'introducer_users' => array()
)
)
)
)
)
)
),
'2' => array(
'uid' => 4,
'introducer_uid' => 1,
'introducer_users' => array()
)
);
My require:
Make a functions to Count deep of item in $mang array.
Sample.
Deep of any item will return look like:
'uid' = 10 will return deep = 3
'uid' = 11 will return deep = 4
'uid' = 8 will return deep = 2
'uid' = 2 will return deep = 1
Sample functions look like
function count_deep($array,$uid){ return $deep; }
Anyone please help me. Thank you so much.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…