opendir
Description
Syntax
opendir(
string $directory,
?resource $context = null
): resource|falseParameters
directory
The directory path that is to be opened
context
For a description of the context parameter, refer to the streams section of the manual.
Return
Returns a directory handle resource on success, or false on failure
Examples
1 · directory
<?
$directory = "/";
if($return = opendir($directory))
{
echo $return;
closedir();
}
Resource id #3
2 · context
<?
$directory = "/";
$context = stream_context_create();
if($return = opendir($directory, $context))
{
echo $return;
closedir();
}
Resource id #3