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);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm lstat() trong PHP - PHP Function

Code $filename = 'test.txt'; echo "<pre>"; print_r(lstat($filename)); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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. ...

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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 ...

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm parse_ini_file() trong PHP - PHP Function

Code $arr = parse_ini_file('C:xamppphpphp.ini'); echo "<pre>"; print_r($arr); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm pathinfo() trong PHP - PHP Function

Code $path = 'C:xamppphpphp.ini'; $arr = pathinfo($path); echo "<pre>"; print_r($arr); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm readfile() trong PHP - PHP Function

Code $path = 'test.txt'; file_put_contents('test.txt', 'this a test'); readfile($path);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm readlink() trong PHP - PHP Function

Code // output e.g. /boot/vmlinux-2.4.20-xfs echo readlink('/vmlinuz');

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm realpath_cache_get() trong PHP - PHP Function

Code echo "<pre>"; print_r(realpath_cache_get()); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm realpath_cache_size() trong PHP - PHP Function

Code echo "<pre>"; print_r(realpath_cache_size()); echo "</pre>";

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm realpath() trong PHP - PHP Function

Code $path = './test.txt'; echo realpath($path);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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');

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm rmdir() trong PHP - PHP Function

Code if (!is_dir('examples')) { mkdir('examples'); } rmdir('examples');

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

Hàm symlink() trong PHP - PHP Function

Code $target = 'uploads.php'; $link = 'uploads'; symlink($target, $link); echo readlink($link);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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);

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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; }

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021

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 ...

Tác giả: Tạ Quốc Bảo viết 14:46 ngày 06/04/2021