I'm trying to create a pedigree and I've got the function to both build and to display the data, I'm just not sure how to format it correctly on output.
I'm trying to work with this css/html http://jsfiddle.net/bZGFA/32/
My array output of the tree information looks like this:
Array(
[id] => IJ6wF
[mother] => Array (
[id] => BzOqN
[mother] => Array (
[id] => 1G3Pl
[mother] =>
[father] =>
)
[father] => Array (
[id] => xWDlH
[mother] =>
[father] =>
)
)
[father] => Array (
[id] => Rstov
[mother] =>
[father] =>
)
)
I'm using a recursive function to build the array. I'm using the following function I found on stackoverflow to display the array.
function displayArrayRecursively($arr, $indent='') {
if ($arr) {
foreach ($arr as $value) {
if (is_array($value)) {
//
displayArrayRecursively($value, $indent . '--');
} else {
// Output
if (!empty($value)) {
echo "$level $indent $value
";
}
}
}
}
}
I'm lost on how I can configure the function to build the table. Any help would be amazing. Thanks!