21,887
社区成员
发帖
与我相关
我的任务
分享
file_put_contents('json.txt',$json,FILE_APPEND);
file_put_contents('content.txt',$content,FILE_APPEND);
print_r($s);
我改为了
file_put_contents('s.txt',$s,FILE_APPEND );
但是打印结果为Array,这样是对的吗? $s = $this->generate_response(
array($this->options['param_name'] => $files),
$print_response
);
print_r($s);
return $s;
return $this->generate_response(
array($this->options['param_name'] => $files),
$print_response
);
<?php
/*
* $_FILES["file"]["type"] - 被上传文件的类型
* $_FILES["file"]["size"] - 被上传文件的大小,以字节计
* $_FILES["file"]["tmp_name"] - 存储在服务器的文件的临时副本的名称
* $_FILES["file"]["error"] - 由文件上传导致的错误代码
*/
/**
*
* @param type $newFileName 新文件名,可以包括完整路径。
* @return int
*/
function saveFile($newFileName) {
if ($_FILES["file"]["error"] > 0) {
return -1;
}
move_uploaded_file($_FILES["file"]["tmp_name"], $newFileName);
return 0;
}
这样就可以了