From c48449a69211d1385f477f4c87896491770ce4c6 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Tue, 20 Mar 2018 12:18:58 -0400 Subject: * Table of contents: add title sort --- sort.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sort.php') diff --git a/sort.php b/sort.php index ab72d49..6e24273 100644 --- a/sort.php +++ b/sort.php @@ -6,6 +6,11 @@ function tocKeysort( $a, $b ){ return ord($aKey[0]) - ord($bKey[0]); } +function tocTitleSort( $a, $b ){ + $aTitle = $a['title']; + $bTitle = $b['title']; + return strcmp( $aTitle, $bTitle ); +} function tocBooksort( $a, $b ){ $bookOrder = array( -- cgit 1.4.1