$v) { $v = trim($v); $v = strip_tags($v); $v = addslashes($v); $data[$k] = $v; } $data['action']=explode('_',$data['action']); try{ include DOCROOT . '/model/' . $data['action'][0] . '/' . $data['action'][0] . '.php'; $api = new $data['action'][0]($data); $api->$data['action'][1](); } catch (Exception $e) { echo $e->getMessage(); } class api { public $data = array(); function __construct($data) { //根据需要,在此加载公用资源; $this->data = $data; } } ?>