PHP code example of rootxs / sudobible

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

    

rootxs / sudobible example snippets


$oBible = new \RootXS\SudoBible([
	'db_host' => 'localhost',
	'db_user' => 'my_user',
	'db_pass' => 'my_super_secure_password',
	'db_name' => 'my_db',
	'translation' => 'ASV',
]);

$oBible->install();

$oPassage = $oBible->verse('John', 3, 16);

$oPassage = $oBible->chapter('John', 3);

$oPassage = $oBible->ref('John', 3, 16, 17); // John 3:16-17
$oPassage = $oBible->ref('Hebrews', 5, 11, 6, 2); // Hebrews 5:11-6:2

$aPassages = $oBible->topic('church'); // returns an array of all related passages
$oPassage = $oBible->topic('church', true); // returns a single, random related passage

echo $oBible->verse('John', 3, 16);

$oPassage = $oBible->ref('John', 3, 16, 17)
	->numberVerses() // adds verse numbers to the passage string
	->useHTML(); // adds some HTML styling to the passage string
echo $oPassage;

$oPassage->numberVerses(false);

$oPassage = $oBible->verse('John', 3, 16);
for ($i=0; $i<2; $i++) {
	echo $oPassage;
	$oPassage = $oPassage->nextVerse();
}

$oBible->uninstall();

$oBible->reinstall();