接口说明:
客户端3种传递JSON参数的方式:原始数据、JSON、或用逗号分割
接口源代码PHP:
<?php
/**
* JSON参数接收及调试 PHP接口源代码
*
* 最后修改:2024-10-12 12:07:01
*
* @author dogstar www.yesapi.cn
*
* 来源:https://open.yesapi.cn/apicode/3065.html
*/
function ($params, $di) {
$result = array('err_code' => 0, 'err_msg' => '');
// 获取接口参数,$params下标要对应你的接口参数名字,例如:
// $name = $params['name'];
// TODO:编写你的API接口逻辑,开发教程:http://yesapi.cn/docs/#/v2.0/function
$result['content'] = 'Hello YesApi';
$result['arr'] = $params['arr'];
// 添加这一行
yesapi_debug(1234);
yesapi_debug('123');
yesapi_debug(123);
yesapi_debug(true);
yesapi_debug(['a', 'b', 'c']);
yesapi_debug(1, 'a', ['a']);
// 返回接口结果
return $result;
}
在线运行
