false, 'results' => array()); $fieldname = get_input('field'); $value = get_input('value'); if ( !$value ) $value = null; if ( $fieldname == "curriculumSubject" ) { //$res['expanding'] = true; $x = getCurriculumChildren($value); if ( $x == false ) { // end } else { $res['expanding'] = true; foreach ( $x as $el ) { $res['results'][] = array($el->eid, $el->title); } } } print json_encode($res); ?>