Streams stream_get_wrappers

(PHP 5, PHP 7, PHP 8)

stream_get_wrappers — 등록된 스트림 목록 검색


설명

stream_get_wrappers(): array

실행 중인 시스템에서 사용할 수 있는 등록된 스트림 목록을 검색합니다.


매개변수

이 함수에는 매개변수가 없습니다.


반환 값

실행 중인 시스템에서 사용할 수 있는 모든 스트림 래퍼의 이름을 포함하는 인덱스 배열을 반환합니다.


Examples

예제 #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
// check for the existence of the bzip2 stream wrapper
if (in_array('compress.bzip2', stream_get_wrappers())) {
    echo 'compress.bzip2:// support enabled.';
} else {
    echo 'compress.bzip2:// support not enabled.';
}
?>
                  
                

기타