stream_filter_remove
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
stream_filter_remove — 从资源流里移除某个过滤器
说明
移除之前通过 stream_filter_prepend() 或者 stream_filter_append() 添加到资源流里面的过滤器。 在移除之前,残留在过滤器内部缓冲区里的所有数据刷新到下一个过滤器。
参数
stream_filter
-
需要被移除的资源流过滤器。
示例
示例 #1 动态地重新过滤一个资源流
<?php
/* 打开测试文件进行读写 */
$fp = fopen("test.txt", "rw");
$rot13_filter = stream_filter_append($fp, "string.rot13", STREAM_FILTER_WRITE);
fwrite($fp, "This is ");
stream_filter_remove($rot13_filter);
fwrite($fp, "a test\n");
rewind($fp);
fpassthru($fp);
fclose($fp);
?>
以上示例会输出:
Guvf vf a test
参见
- stream_filter_register() - Register a user defined stream filter
- stream_filter_append() - Attach a filter to a stream
- stream_filter_prepend() - Attach a filter to a stream
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/function.stream-filter-remove.php