后端技术
PHPObject转Array 2025-02-26
publicfunctionobject_to_array($obj){$_arr=is_object($obj)?get_object_vars($obj):$obj;$arr=null;foreach($_arras$key=>$val){$val=(is_array($val))||is_object($val)?$this->object_to_array($val):$val;$arr[$key]=$val;}return$arr;}$task_data=$this->object_to_array(json_decode(htmlspecialchars_deco
后端技术
PHP万能读取请求参数 2025-02-26
前端使用POST方式传递数据(跨域)axios.post('http://xxx.xxx.xxx.xxx:8888/xxx/xxx/xxx',{xxxForm}).then(res=>{})ThinkPHP后端使用I(“post.”)接收不到数据,get,request,put都试了一遍原来使用的是put使用put读取出来数据…,有点小乱,json_decode也用不了。array(1){["{"ruleForm":{"rules":"]=>array(1){["{"field"
热门文章
专栏