PHP code example of techwilk / bible-verse-parser

1. Go to this page and download the library: Download techwilk/bible-verse-parser 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/ */

    

techwilk / bible-verse-parser example snippets


foreach ($passages as $passage) {
    echo $passage->from()->integerNotation();
    echo ' (' . (string)$passage->from() . ')' . PHP_EOL;

    echo $passage->to()->integerNotation();
    echo ' (' . (string)$passage->to() . ')' . PHP_EOL;

    echo PHP_EOL;
}
 php
    use TechWilk\BibleVerseParser\BiblePassageParser;

    $passageParser = new BiblePassageParser();
    
 php
/** @var BiblePassage[] */
$passages = $passageParser->parse('1 John 5:4-17, 19-21 & Esther 2');
 php
foreach ($passages as $passage) {
    echo (string) $passage . PHP_EOL;
}
 php
foreach ($passages as $passage) {
    echo "From {$passage->from()->book()->name()}";
    echo " chapter {$passage->from()->chapter()}";
    echo " verse {$passage->from()->verse()}";

    echo ", to {$passage->to()->book()->name()}";
    echo " chapter {$passage->to()->chapter()}";
    echo " verse {$passage->to()->verse()}." . PHP_EOL;
}