Hàm link() trong PHP - PHP Function
Code $target = 'source.ext'; // This is the file that already exists $link = 'newfile.ext'; // This the filename that you want to link it to link($target, $link);
Hàm lstat() trong PHP - PHP Function
Code $filename = 'test.txt'; echo "<pre>"; print_r(lstat($filename)); echo "</pre>";
Hàm mkdir() trong PHP - PHP Function
Hàm mkdir() sẽ tạo mới thư mục theo đúng đường dẫn truyền vào. Cú pháp Cú pháp : mkdir( $filename, $mode, $recursive, $context); Trong đó : $filename là đường dẫn sẽ tạo thư mục. $mode là quyền của thư mục, mặc định là 0777. ...
Hàm move_uploaded_file() trong PHP - PHP Function
Code $uploads_dir = '/uploads'; foreach ($_FILES["pictures"]["error"] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES["pictures"]["tmp_name"][$key]; // basename() may prevent filesystem traversal attacks; // further ...
Hàm parse_ini_file() trong PHP - PHP Function
Code $arr = parse_ini_file('C:xamppphpphp.ini'); echo "<pre>"; print_r($arr); echo "</pre>";
Hàm parse_ini_string() trong PHP - PHP Function
Code //lấy về chuỗi ini $str = file_get_contents('C:xamppphpphp.ini'); $arr = parse_ini_string($str); echo "<pre>"; print_r($arr); echo "</pre>";
Hàm pathinfo() trong PHP - PHP Function
Code $path = 'C:xamppphpphp.ini'; $arr = pathinfo($path); echo "<pre>"; print_r($arr); echo "</pre>";
Hàm readfile() trong PHP - PHP Function
Code $path = 'test.txt'; file_put_contents('test.txt', 'this a test'); readfile($path);
Hàm readlink() trong PHP - PHP Function
Code // output e.g. /boot/vmlinux-2.4.20-xfs echo readlink('/vmlinuz');
Hàm realpath_cache_get() trong PHP - PHP Function
Code echo "<pre>"; print_r(realpath_cache_get()); echo "</pre>";
Hàm realpath_cache_size() trong PHP - PHP Function
Code echo "<pre>"; print_r(realpath_cache_size()); echo "</pre>";
Hàm realpath() trong PHP - PHP Function
Code $path = './test.txt'; echo realpath($path);
Hàm rename() trong PHP - PHP Function
Code mkdir('test'); $path = 'test/test.txt'; file_put_contents($path, 'this is a test'); rename($path, 'example.txt');
Hàm rewind() trong PHP - PHP Function
Code $path = 'example.txt'; $fp = fopen($path, 'r+a+'); fseek($fp, 5); echo ftell($fp)."<br />"; rewind($fp); echo ftell($fp);
Hàm rmdir() trong PHP - PHP Function
Code if (!is_dir('examples')) { mkdir('examples'); } rmdir('examples');
Hàm symlink() trong PHP - PHP Function
Code $target = 'uploads.php'; $link = 'uploads'; symlink($target, $link); echo readlink($link);
Hàm tempnam() trong PHP - PHP Function
Code echo $tmpfname = tempnam("./example/", "test"); $handle = fopen($tmpfname, "w"); fwrite($handle, "this is a test string"); fclose($handle);
Hàm tmpfile() trong PHP - PHP Function
Code $temp = tmpfile(); fwrite($temp, "this is a test file content"); fseek($temp, 0); echo fread($temp, 1024); fclose($temp); // this removes the file
Hàm touch() trong PHP - PHP Function
Code $filename = 'example.txt'; if (touch($filename)) { echo $filename . ' modification time has been changed to present time'; } else { echo 'Sorry, could not change modification time of ' . $filename; }
Hàm checkdate() trong PHP - PHP Function
Code if (checkdate(12,3,1995) == true) { echo "ngày 12-3-1995 là ngày hợp lệ <br />"; }else{ echo "ngày 12-3-1995 là ngày không hợp lệ <br />"; } if (checkdate(30,2,1995) == true) { echo "ngày 30-2-1995 là ngày hợp lệ <br />"; }else{ echo "ngày 30-2-1995 ...







