0){ // Get the *actual* name of the collection, in case there are accent marks (like "Arsène Lupin") foreach($ebooks[0]->Collections as $c){ if($collection == strtolower(str_replace('-', ' ', Formatter::RemoveDiacritics($c->Name)))){ $collection = (string)$c->Name; // Explicit typecast to string to satisfy PHPStan } } } $collectionName = ucwords(preg_replace('/^The /ius', '', $collection) ?? ''); $pageTitle = 'Browse ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection'; $pageDescription = 'A list of ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection'; $pageHeader = 'Ebooks in the ' . Formatter::ToPlainText($collectionName) . ' collection'; } else{ $pageTitle = 'Browse Standard Ebooks'; $pageHeader = 'Browse Ebooks'; $ebooks = Library::GetEbooks($sort); $pages = ceil(sizeof($ebooks) / EBOOKS_PER_PAGE); $totalEbooks = sizeof($ebooks); $ebooks = array_slice($ebooks, ($page - 1) * EBOOKS_PER_PAGE, EBOOKS_PER_PAGE); $pageDescription = 'Page ' . $page . ' of the Standard Ebooks ebook library, sorted '; switch($sort){ case SORT_NEWEST: $pageDescription .= 'by newest ebooks first.'; break; case SORT_AUTHOR_ALPHA: $pageDescription .= 'alphabetically by author name.'; break; case SORT_READING_EASE: $pageDescription .= 'by easiest ebooks first.'; break; case SORT_LENGTH: $pageDescription .= 'by shortest ebooks first.'; break; } } } catch(\Exception $ex){ http_response_code(404); include(SITE_ROOT . '/web/www/404.php'); exit(); } ?> $pageTitle, 'highlight' => 'ebooks', 'description' => $pageDescription]) ?>

$query]) ?>

No ebooks matched your search. You can try different search terms, or browse all of our ebooks.

$ebooks]) ?> 0 && $query === null && $tag === null && $collection === null){ ?> 0 && $tag !== null){ ?> 0 && $query === null && $tag === null && $collection === null){ ?>