Go to letter: ';
+foreach(range('A','Z') as $letter)
+{
+ echo "$letter ";
+}
+echo "
+ ";
+echo '
';
$url = $APIurl."/json/timingpoints";
if ($_REQUEST['allstops']) $url = $APIurl."/json/stops";
if ($_REQUEST['lat'] && $_REQUEST['lon']) $url = $APIurl."/json/neareststops?lat={$_REQUEST['lat']}&lon={$_REQUEST['lon']}&limit=15";
@@ -19,13 +29,16 @@
$stopName[$key] = $row[1];
}
-// Sort the data with volume descending, edition ascending
-// Add $data as the last parameter, to sort by the common key
+// Sort the stops by name
array_multisort($stopName, SORT_ASC, $contents);
+$firstletter = "";
foreach ($contents as $row)
{
-
+ if (substr($row[1],0,1) != $firstletter){
+ echo "";
+ $firstletter = substr($row[1],0,1);
+ }
echo '