It returns realpath cache entries
Example
<?php
echo “<pre>”;
print_r(realpath_cache_get());
?>
It returns realpath cache entries
Example
<?php
echo “<pre>”;
print_r(realpath_cache_get());
?>
It returns the target of a symbolic link
Example
<?php
echo readlink(‘test’);
?>
It outputs a file
Example
<?php
$file = ‘test.txt’;
if (file_exists($file)) {
header(‘Content-Description: File Transfer’);
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=’.basename($file));
header(‘Content-Transfer-Encoding: binary’);
header(‘Expires: 0’);
header(‘Cache-Control: must-revalidate’);
header(‘Pragma: public’);
header(‘Content-Length: ‘ . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
?>
It opens process file pointer
Example
<?php
$pfp = popen(‘/bin/ls’, ‘r’);
pclose($pfp);
?>
It closes process file pointer
Example
<?php
$pfp = popen(‘/bin/ls’, ‘r’);
pclose($pfp);
?>
It returns information about a file path
Example
<?php echo "<pre>"; print_r(pathinfo("test.ini")); ?>
Output
Array
(
[dirname] => .
[basename] => test.ini
[extension] => ini
[filename] => test
)
It parse a configuration string
Example
<?php
echo “<pre>”;
print_r(parse_ini_string(file_get_contents(“test.ini”)));
?>
Output
Array
(
[me] => phpcodez
[first] => http://www.phpcodez.com
)
“test.ini” file content
[names]
me = phpcodez
[urls]
first = “http://www.phpcodez.com”
It parses a configuration file
Example
<?php
echo “<pre>”;
print_r(parse_ini_file(“test.ini”));
?>
Output
Array
(
[me] => phpcodez
[first] => http://www.phpcodez.com
)
“test.ini” file content
[names]
me = phpcodez
[urls]
first = “http://www.phpcodez.com”
It moves an uploaded file to a new location. It is used to validate whether the contents of $_FILES[‘name’][‘tmp_name’] have really been uploaded via HTTP, and also save the contents into another folder.
Example
<?php move_uploaded_file($tmp_name, $_FILES["file"]["name"]) or die("Failed"); ?>
It can be used to create directory
Example
<?php
mkdir(“test/”) or die(“Failed”);
?>