PHP code example of nigo / fb2-book

1. Go to this page and download the library: Download nigo/fb2-book 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/ */

    

nigo / fb2-book example snippets




igo\Fb2Book\Fb2Book;

$fb2book = new Fb2Book();

$xmlBook = $fb2book->setTitle('My FB2 book')
    ->setAuthor('First Name', 'Last Name')
    ->setAnnotation('My book annotation')
    ->setBookLang('en')
    ->addSection('First section for book', 'Chapter one')
    ->addSection('Second section for book', 'Chapter two')
    ->create();

echo $xmlBook;