(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
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant