Nick.LaPrell.org

Bible Citation

Bible Citation is a small PHP class I wrote that takes raw text and replaces all bible citations with links to the citation on Bible Gateway. The links are returned with multiple HTML classes, allowing you to style your links according to the following classifications:

Example Usage:

<php

// Include this file.
include('bible_citation.class.php');

$string='This is a citation of John 3:16.';

// Call the class, referencing the path to data.xml
$bible = new bibleCitations ('path/to/xml/data.xml');

//Set the translation to King James Version.
$bible->setTranslation('KJV');

// Set the links to not pop in a new window
$bible->popInNewWindow=false;

// Echo out the transformed text.
echo $bible->processText($string);

?>

This will output:

This is a citation of <a href="http://www.biblegateway.com/passage/?search=John+3%3A16.&amp;version=9" class="John bibleCitation newTestament gospel">John 3:16.</a>

Download

Version Release Date Release Notes Download
0.9 September 19, 2007

This is the first release of this class, so it is bound to be buggy. If you find any bugs or have any suggestions for improvements, please feel free to contact me at Nick@LaPrell.org.