PHP code example of liberu-genealogy / php-dna

1. Go to this page and download the library: Download liberu-genealogy/php-dna 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/ */

    

liberu-genealogy / php-dna example snippets


spl_autoload_register(function ($class) {
    $pathToDna = __DIR__ . '/library/'; // TODO FIXME

    if (!substr(ltrim($class, '\\'), 0, 7) == 'Dna\\') {
        return;
    }

    $class = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
    if (file_exists($pathToDna . $class)) {