文字列フィルタ
これらのフィルタは、まさしくその名が示すとおりの働きをし、PHP 組み込み の文字列処理関数と同じように動作します。これらのフィルタについての より詳しい情報は、対応する関数のマニュアルを参照してください。
string.rot13
このフィルタは、すべてのストリームデータに対して str_rot13() 関数を適用するのと同じ動作をします。
例1 string.rot13
<?php$fp = fopen('php://output', 'w');stream_filter_append($fp, 'string.rot13');fwrite($fp, "This is a test.\n");/* 出力: Guvf vf n grfg. */?>
string.toupper
このフィルタは、すべてのストリームデータに対して strtoupper() 関数を適用するのと同じ動作をします。
例2 string.toupper
<?php$fp = fopen('php://output', 'w');stream_filter_append($fp, 'string.toupper');fwrite($fp, "This is a test.\n");/* 出力: THIS IS A TEST. */?>
string.tolower
このフィルタは、すべてのストリームデータに対して strtolower() 関数を適用するのと同じ動作をします。
例3 string.tolower
<?php$fp = fopen('php://output', 'w');stream_filter_append($fp, 'string.tolower');fwrite($fp, "This is a test.\n");/* 出力: this is a test. */?>