PHP code example of jkrrv / scripturnum

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

    

jkrrv / scripturnum example snippets


$s = new ScripturNum('Romans 1-8');
var_dump($s);
echo $s;

$s = new ScripturNum(739119536);
var_dump($s);
echo $s;

//   ScripturNum::newFromInts($book, $startCh, $startV = 1, $endCh = null, $endV = null)
$n = ScripturNum::newFromInts(40, 8, null, 9);
var_dump($n);
echo $n;

echo new ScripturNum('1Jo1:9')

echo (new ScripturNum('John 3:16'))->getAbbrev();

$a = new ScripturNum('John 3:16');
$f = function (string $s, ScripturNum $sn) {
    $sc = $sn->getWholeChapters();
    return "<a href=\"https://www.esv.org/" . strtolower($sc->toString('abbrev')) . "\">$s</a>";
};
echo $a->toString(['callback' => $f]);

$s = new ScripturNum('Romans 8');
$wheres = $s->toSqlInclusive('Scripture');

$queryString = "SELECT * FROM scriptureData WHERE $wheres";