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
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”);
?>
It returns information about a file or symbolic link
Example
<?php
echo “<pre>”;
symlink(‘test.php’, ‘test’);
print_r(lstat(‘test’));
?>
Output
Array
(
[0] => 2049
[1] => 673770
[2] => 41471
[3] => 1
[4] => 33
[5] => 33
[6] => 0
[7] => 8
[8] => 1336807250
[9] => 1336807250
[10] => 1336807250
[11] => 4096
[12] => 0
[dev] => 2049
[ino] => 673770
[mode] => 41471
[nlink] => 1
[uid] => 33
[gid] => 33
[rdev] => 0
[size] => 8
[atime] => 1336807250
[mtime] => 1336807250
[ctime] => 1336807250
[blksize] => 4096
[blocks] => 0
)
It returns information about a link
Example
<?php
echo linkinfo(‘test.txt’);
?>
Output
2049
It creates a hard link
Example
<?php
$target = ‘test.ext’;
$link = ‘test’;
link($target, $link);
echo $link;
?>
Output
test
It changes user ownership of symlink
Example
<?php
$target = ‘test.php’;
$link = ‘test’;
symlink($target, $link);
lchown($link, 8);
?>
It changes group ownership of symlink
Example
<?php
$target = ‘test.php’;
$link = ‘test’;
symlink($target, $link);
lchgrp($link, 8);
?>
Its an Alias of is_writable() and checks whether the filename is writable
Example
<?php
echo is_writeable(‘test.txt’)?”Yes”:”No”;
?>
Output
Yes
It checks whether the filename is writable
Example
<?php
echo is_writable(‘test.txt’)?”Yes”:”No”;
?>
Output
Yes
Zend | Magento Certified PHP | eCommerce Architect