Sort: Rank

How To Get the Directory Name out of a File Path Name
How To Get the Directory Name out of a File Path Name? - PHP Script Tips - Working with Directoris and Files If you have the full path name of a file, and want to get the directory name portion of the path name, you can use the dirname() function. It breaks the full path name at the last directory p...
2007-04-23, 4916👍, 0💬

How To Break a File Path Name into Parts
How To Break a File Path Name into Parts? - PHP Script Tips - Working with Directoris and Files If you have a file name, and want to get different parts of the file name, you can use the pathinfo() function. It breaks the file name into 3 parts: directory name, file base name and file extension; and...
2007-04-23, 4847👍, 0💬

How To Dump the Contents of a Directory into an Array
How To Dump the Contents of a Directory into an Array? - PHP Script Tips - Working with Directoris and Files If you want to get the contents of a directory into an array, you can use the scandir() function. It gets a list of all the files and sub directories of the specified directory and returns th...
2007-04-23, 6829👍, 0💬

How To Read a Directory One Entry at a Time
How To Read a Directory One Entry at a Time? - PHP Script Tips - Working with Directoris and Files If you want to read a directory one entry at a time, you can use opendir() to open the specified directory to create a directory handle, then use readdir() to read the directory contents through the di...
2007-04-23, 4700👍, 0💬

How To Remove a File
How To Remove a File? - PHP Script Tips - Working with Directoris and Files If you want to remove an existing file, you can use the unlink() function. Here is a PHP script example on how to use unlink(): <?php if (file_exists("/temp/todo.txt") ){ unlink("/temp/todo.txt"); print("File removed....
2007-04-23, 4727👍, 0💬

How To Copy a File
How To Copy a File? - PHP Script Tips - Working with Directoris and Files If you have a file and want to make a copy to create a new file, you can use the copy() function. Here is a PHP script example on how to use copy(): <?php unlink("/temp/myPing.exe"); copy("/windows/system32/ping.e xe","...
2007-04-23, 4728👍, 0💬

How To Remove an Empty Directory
How To Remove an Empty Directory? - PHP Script Tips - Working with Directoris and Files If you have an empty existing directory and you want to remove it, you can use the rmdir(). Here is a PHP script example on how to use rmdir(): <?php if (file_exists("/temp/download") ){ rmdir("/temp/downl...
2007-04-23, 4699👍, 0💬

How To Create a Directory
How To Create a Directory? - PHP Script Tips - Working with Directoris and Files You can use the mkdir() function to create a directory. Here is a PHP script example on how to use mkdir(): <?php if (file_exists("/temp/download") ){ print("Directory already exists.\n"); } else { mkdir("/temp/d...
2007-04-23, 4634👍, 0💬

  Sort: Rank