Created
July 11, 2013 02:04
-
-
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.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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