downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

stream_is_local> <stream_get_transports
[edit] Last updated: Fri, 17 May 2013

view this page in

stream_get_wrappers

(PHP 5)

stream_get_wrappers登録されているストリームのラッパーのリストを取得する

説明

array stream_get_wrappers ( void )

実行中のシステムで使用可能な、登録済みのストリームの一覧を取得します。

返り値

スクリプトを走らせているシステム上で使うことのできるすべてのストリーム ラッパーの名前を配列の形で返します。

例1 stream_get_wrappers() の例

<?php
print_r
(stream_get_wrappers());
?>

上の例の出力は、 たとえば以下のようになります。

Array
(
    [0] => php
    [1] => file
    [2] => http
    [3] => ftp
    [4] => compress.bzip2
    [5] => compress.zlib
)

例2 ストリームラッパーのが存在するかどうかを調べる

<?php
// bzip2 ストリームラッパーが存在するかどうかを調べます
if (in_array('compress.bzip2'stream_get_wrappers())) {
    echo 
'compress.bzip2:// サポートが有効です。';
} else {
    echo 
'compress.bzip2:// サポートは有効ではありません。';
}
?>

参考



add a note add a note User Contributed Notes stream_get_wrappers - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites