/**
* 创建一个JSON格式的数据
*
* @access public
* @param string $content
* @param integer $error
* @param string $message
* @param array $append
* @return void
*/
function make_json_response($content='', $error="0", $message='', $append=array())
{
include_once(ROOT_PATH . 'includes/cls_json.php');
$json = new JSON;
$res = array('error' => $error, 'message' => $message, 'content' => $content);
if (!empty($append))
{
foreach ($append AS $key => $val)
{
$res[$key] = $val;
}
}
$val = $json->encode($res);
exit($val);
}
/**
*
*
* @access public
* @param
* @return void
*/
function make_json_result($content, $message='', $append=array())
{
make_json_response($content, 0, $message, $append);
}
/**
* 创建一个JSON格式的错误信息
*
* @access public
* @param string $msg
* @return void
*/
function make_json_error($msg)
{
make_json_response('', 1, $msg);
}
?>ECSHOP info: Can't Connect MySQL Server(localhost)!