MOON
Server: Apache
System: Linux 3-228-103-98.cprapid.com 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64
User: api (1001)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/api/public_html/nashville/get-schools.php
<?php
$aCities = array();
$aAreas = array();
$aSchoolTypes = array();
$aValidSchoolTypes = array( "elementary", "middle", "high" );
foreach ( $_GET as $k => $v )
{
    switch( strtolower( $k ) )
    {
        case "cities":
            $aCities = explode( ",", $v );
            break;
        case "areas":
            $aAreas = explode( ",", $v );
            break;
        case "types":
            $atmp = explode( ",", $v );
            foreach( $atmp as $sS )
            {
                if ( in_array( strtolower( $sS ), $aValidSchoolTypes ) )
                    $aSchoolTypes[] = strtolower( $sS );
            }
            break;
    }
}

require( "php/config.php" );

$oMLS = new oMLS();
$aSchools = $oMLS->getSchools( $aCities, $aAreas, $aSchoolTypes );
$oRes = new Result( "Schools" );
foreach ( $aSchools as $kType => $aData )
    $oRes->addData( $aData, $kType );

$oMLS->finish( "nashville", "schools", json_encode( $_GET ) );

print $oRes->getJSON();