<?php
Directory {
/* Properties */
public string $path ;
public resource $handle ;
/* Methods */
public void close ([ resource $dir_handle ] )
public string read ([ resource $dir_handle ] )
public void rewind ([ resource $dir_handle ] )
}
?>
<?php
Directory dir ( str $directory , res $context = ? )
where,
$directory = The directory to be open
$context = The stream context wrapper
?>
<?php
$dir01 = dir(__DIR__);
echo 'HANDLE:<br>' . $dir01->handle . '<br><br>' .
'PATH:<br>' . $dir01->path;
$dir01->close();
?>
<?php
define('PATH2TPW', 'file://' . __DIR__ . '/temp/');
$o02 = [ 'https' => [ 'method'=>"POST",
'header' => "Accept-language: en",
'user' => "Zero Fernandes",
'content' => 'Non ducor duco' ] ];
foreach($o02 as $k02 => $v02)
{
echo '<pre>';
var_dump($v02);
}
$c02 = stream_context_create($o02);
$dir02 = dir(PATH2TPW, $c02);
echo 'HANDLE:<br>' . $dir02->handle . '<br><br>' .
'PATH:<br>' . $dir02->path;
$dir02->close();
echo '</pre>';
?>