• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • stream_get_filters()

    (PHP 5, PHP 7)

    获取已注册的数据流过滤器列表

    说明

    stream_get_filters(void): array

    获取当前运行系统中已注册的数据流过滤器列表。

    返回值

    返回一个包含所有有效的数据流过滤器名字的索引数组。

    范例

    使用stream_get_filters()

    <?php
    $streamlist = stream_get_filters();
    print_r($streamlist);
    ?>
    

    以上例程的输出类似于:

    Array (
      [0] => string.rot13
      [1] => string.toupper
      [2] => string.tolower
      [3] => string.base64
      [4] => string.quoted-printable
    )
    

    参见

    Filters to be used within the convert filter are base64-encode, base64-decode, quoted-printable-encode and quoted-printable-decode. Note: those are not in the string filter, as currently reported by the manual!
    Example usage is:
    <?php
    $h = fopen('gecodeerd.txt', 'r');
    stream_filter_append($h, 'convert.base64-decode');
    fpassthru($h);
    fclose($h);
    ?>
    Or
    <?php
    $filter = 'convert.base64-decode';
    $file = 'coded.txt';
    $h = fopen('php://filter/read=' . $filter . '/resource=' . $file,'r'); 
    fpassthru($h);
    fclose($h);
    ?>