[javascript]代码库
/**
* 创建一个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 );
}
中级程序员
by: 黑色技术 发表于:2013-07-07 15:08:00 顶(1) | 踩(0) 回复
....这是php的好吧?
回复评论