可能重複:
In PHP, after assigning a file pointer resource to a variable with fopen(), how can I get the file name from the variable?如何獲取有關資源的更多信息?
例子:
$this->resource = fopen('c:\wamp\www\some_file.txt', 'a');
現在,如果我稍後再嘗試訪問$this->resource
,在不同的方法獲得:
Resource id #51: stream
我可以得到實際的文件路徑嗎?
你怎麼能不知道你打開的是什麼文件? – Gntem 2012-07-28 13:29:32