DirectoryIterator::isExecutable

(PHP 5, PHP 7)

DirectoryIterator::isExecutableDetermine if current DirectoryIterator item is executable

설명

public bool DirectoryIterator::isExecutable ( void )

Determines if the current DirectoryIterator item is executable.

인수

이 함수는 인수가 없습니다.

반환값

Returns TRUE if the entry is executable, otherwise FALSE

예제

Example #1 DirectoryIterator::isExecutable() example

This example lists files in the directory containing the script which are executable.

<?php
$iterator 
= new DirectoryIterator(dirname(__FILE__));
foreach (
$iterator as $fileinfo) {
    if (
$fileinfo->isExecutable()) {
        echo 
$fileinfo->getFilename() . "\n";
    }
}
?>

위 예제의 출력 예시:

example.php
myscript.sh

참고

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top