Wic*_*wok 10
您可以使用get_resource_type()
- http://us3.php.net/manual/en/function.get-resource-type.php.如果函数根本不是资源,则该函数将返回FALSE.
$fp = fopen("foo", "w");
...
if(get_resource_type($fp) == 'file' || get_resource_type($fp) == 'stream') {
//do what you want here
}
Run Code Online (Sandbox Code Playgroud)
PHP文档说上面的函数调用应该返回'file',但在我的设置中它返回'stream'.这就是我检查上述结果的原因.
归档时间: |
|
查看次数: |
2408 次 |
最近记录: |