Skip to content

Instantly share code, notes, and snippets.

@khornberg
Created July 11, 2013 02:04
Show Gist options
  • Save khornberg/5971924 to your computer and use it in GitHub Desktop.
Save khornberg/5971924 to your computer and use it in GitHub Desktop.
Extract bible book from well formed bible reference (e.g. John 1, 1 John 5:1-3, etc.)
public function get_bible_book( $text )
{
preg_match('/(^\w{1,3}\s)?\w+/', $text, $matches);
return $matches[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment