“Family Tree” Data Structure
问题 I'm looking for a way to represent a family tree in PHP. This means that children will need to inherit from two (or more) parents. Here are the requirements: 1, 2, or more parents Bonus points if I can attach metadata like a last name or relationship status Here is my non-working attempt (no arrays as keys, sadly): $tree = array( 'uncle' => false, // no children array('mom', 'dad') => array( 'me' => false, array('brother', 'sister-in-law') => array( 'niece' => false ) ) ); The question is,