// Sort on occurence from high to low. arsort($passages, SORT_NUMERIC); // Output the passage identifiers to the browser. // Skip identifiers that only occur once. foreach ($passages as $key => $value) { if ($value <= 1) { continue; } echo "{$key}\n"; } die; } @($id = $_GET['id']); if (isset($id)) { // Get the and passage for this identifier. $passage = Filter_Books::integer2passage($id); $book = $passage[0]; $chapter = $passage[1]; $verse = $passage[2]; // Get the plain text. $text = $database_search->getBibleVerseText($bible, $book, $chapter, $verse); // Format it. $link = Filter_Books::linkForOpeningEditorAt($book, $chapter, $verse); $output = "<div>{$link} {$text}</div>"; // Output to browser. echo $output; // Done. die; } $header = new Assets_Header(Locale_Translate::_("Search")); $header->run();
public function testPassageInteger() { $standard = explode(".", "6.4.2"); $numeric = Filter_Books::passage2integer($standard); $passage = Filter_Books::integer2passage($numeric); $this->assertEquals($standard, $passage); }