PHP code example of pzoechner / ged-tree

1. Go to this page and download the library: Download pzoechner/ged-tree library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pzoechner / ged-tree example snippets


$tree = Tree::load(__DIR__ . 'file.ged');

$individuals = $tree->getIndividuals();

$individual = $individuals->first();
$individual->id;            // '@I2@'
$individual->name->first;   // 'Julia'
$individual->name->last;    // 'Doe'
$individual->name->married; // 'Williams'

$families = $tree->getFamilies();

$family = $families->first();
$family->id;               // '@F1@'
$family->pointers;         // ['@I2@', '@I3@']