这种的数据要怎么取值

object(EasySwoole\Core\Http\Message\UploadFile)#44 (6) {
  ["tempName":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(25) "/tmp/swoole.upfile.82hJyH"
  ["stream":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  object(EasySwoole\Core\Http\Message\Stream)#45 (6) {
    ["stream":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    resource(52) of type (stream)
    ["seekable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["readable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["writable":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    bool(true)
    ["readList":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    array(16) {
      ["r"]=>
      bool(true)
      ["w+"]=>
      bool(true)
      ["r+"]=>
      bool(true)
      ["x+"]=>
      bool(true)
      ["c+"]=>
      bool(true)
      ["rb"]=>
      bool(true)
      ["w+b"]=>
      bool(true)
      ["r+b"]=>
      bool(true)
      ["x+b"]=>
      bool(true)
      ["c+b"]=>
      bool(true)
      ["rt"]=>
      bool(true)
      ["w+t"]=>
      bool(true)
      ["r+t"]=>
      bool(true)
      ["x+t"]=>
      bool(true)
      ["c+t"]=>
      bool(true)
      ["a+"]=>
      bool(true)
    }
    ["writeList":"EasySwoole\Core\Component\Spl\SplStream":private]=>
    array(17) {
      ["w"]=>
      bool(true)
      ["w+"]=>
      bool(true)
      ["rw"]=>
      bool(true)
      ["r+"]=>
      bool(true)
      ["x+"]=>
      bool(true)
      ["c+"]=>
      bool(true)
      ["wb"]=>
      bool(true)
      ["w+b"]=>
      bool(true)
      ["r+b"]=>
      bool(true)
      ["x+b"]=>
      bool(true)
      ["c+b"]=>
      bool(true)
      ["w+t"]=>
      bool(true)
      ["r+t"]=>
      bool(true)
      ["x+t"]=>
      bool(true)
      ["c+t"]=>
      bool(true)
      ["a"]=>
      bool(true)
      ["a+"]=>
      bool(true)
    }
  }
  ["size":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  int(288785)
  ["error":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  int(0)
  ["clientFileName":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(26) "103836s44klqli6xeldaoo.jpg"
  ["clientMediaType":"EasySwoole\Core\Http\Message\UploadFile":private]=>
  string(10) "image/jpeg"
}
噜噜哒
浏览 475回答 3
3回答

侃侃无极

首先你得要学会肿么看文档,第一个你已经找到类了,为何不直接看源代码呢.以下是我从源代码中截取的. public function getStream() { // TODO: Implement getStream() method. return $this->stream; } public function moveTo($targetPath) { // TODO: Implement moveTo() method. return file_put_contents($targetPath,$this->stream) ? true :false; } public function getSize() { // TODO: Implement getSize() method. return $this->size; } public function getError() { // TODO: Implement getError() method. return $this->error; } public function getClientFilename() { // TODO: Implement getClientFilename() method. return $this->clientFileName; } public function getClientMediaType() { // TODO: Implement getClientMediaType() method. return $this->clientMediaType; } 请自行查看源码.UploadFile

胡说叔叔

外部的话只有 public 能取到值 而你这一堆 private

12345678_0001

很像thinkphp的风格,楼主可以把获取这玩意的代码贴出来,或许可以用其他更方便的方式获取
打开App,查看更多内容
随时随地看视频慕课网APP