Found 1466 Articles for PHP

is_writeable() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:18:53

57 Views

The is_writeable() function checks whether a file is writeable. It returns TRUE if the file exists and is writeable.The is_writeablle() function is an alias of is_writable(). A benefit of using is_writeable() instead of is_writable() is that the is_writable() function will pollute search results when searching source code for files containing the word "table".Syntaxis_writeable(file_path)Parametersfile_path − The path of the file to be checked.ReturnThe is_writeable() function returns TRUE if the file exists and is writeable.Example Live DemoOutputFile is not writeable!

is_writable() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:19:18

72 Views

The is_writable() function checks whether a file is writeable. It returns TRUE if the file exists and is writeable.Syntaxis_writable(file_path)Parametersfile_path − The path of the file to be checked.ReturnThe is_writable() function returns TRUE if the file exists and is writeable.Example Live DemoOutputFile is not writeable!Let us see another example.ExampleOutputFile is writeable! Permission: 0777

is_uploaded_file() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:20:15

264 Views

The is_uploaded_file() function checks whether a file was uploaded via HTTP POST. The function returns TRUE if the file is uploaded via HTTP POST. It returns FALSE on failure.Syntaxis_uploaded_file(file_path)Parametersfile_path − Specify the file to be checked.ReturnThe is_uploaded_file() function returns TRUE if the file is uploaded via HTTP POST. It returns FALSE on failure.Let’s say we are uploading a file “new.txt” with the following content.This is demo text!Example

is_readable() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:20:39

330 Views

The is_readable() function checks whether a file is readable. The function returns TRUE if the file or directory exists and is readable. It returns FALSE if the file or directory does not exist.Syntaxis_readable(file_path)Parametersfile_path − Specify the file to check.ReturnThe is_readable() function returns TRUE if the file or directory exists and is readable. It returns FALSE if the file or directory does not exist.Example Live DemoOutputNot readable!Let us see another example that also reads the file if it is readable.We have a file “demo.txt” with the following content.This is demo text in demo file!The following is the code that checks whether the ... Read More

is_link() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:21:06

85 Views

The is_link() function checks whether a file is a symbolic link or not. It returns TRUE, if the file exists and is a symbolic link. On failure, it returns FALSE.Syntaxis_link(file_path)Parametersfile_path − The file to checkReturnThe is_link() function returns TRUE, if the file exists and is a symbolic link. On failure, it returns FALSE.Example Live DemoOutputnot a linkLet us see another example.Example Live DemoOutputnot a link

is_file() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:22:47

52 Views

The is_file() function checks whether a file is a regular file. It returns TRUE if it is a regular file.Syntaxis_file(file_path)Parametersfile_path − The path of the file.ReturnThe is_file() function returns TRUE if it is a regular file.Example Live DemoOutputNot a regular file!

is_executable() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:23:10

140 Views

The is_executable() function checks whether a file is executable. It returns TRUE if the file exists and is executable. It returns FALSE on error.Syntaxis_executable(file_path)Parametersfile_path − The path of the file.ReturnThe is_executable() function returns TRUE if the file exists and is executable. It returns FALSE on error.Example Live DemoOutputExecutable!Let us see another example.Example Live DemoOutputNot executable!

is_dir() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:23:30

103 Views

The is_dir() function checks whether a file is a directory. It returns TRUE if the directory is found.Syntaxis_dir(file_path)Parametersfile_path − Specify the path of the file.ReturnThe is_dir() function returns TRUE if the directory is found.Example Live DemoOutputNot a directory!

glob() function in PHP

Samual Sam
Updated on 24-Jun-2020 08:57:19

2K+ Views

The glob() function returns an array of filenames or directories matching a specified pattern. The glob() function returns.An array containing the matched files/directories, Returns an empty array if no file is matched, FALSE on error.Syntaxglob(pattern, flags)Parameterspattern − The pattern to search for.flags − The following are the flags:GLOB_MARK - Adds a slash to each item returnedGLOB_NOSORT - Return files as they appear in the directory (unsorted)GLOB_NOCHECK - Returns the search pattern if no match were foundGLOB_NOESCAPE - Backslashes do not quote metacharactersGLOB_BRACE - Expands {p, q, r} to match 'p', 'q', or 'r'GLOB_ONLYDIR - Return only directories which match the ... Read More

fwrite() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 08:57:39

264 Views

The fwrite() function writes to an open file. It returns the number of bytes written on success, whereas returns False on failure.Syntaxfwrite(file_pointer, string, length)Parametersfile_pointer − A file system pointer created using fopen(). Required.string − The string to be written. Required.length − Maximum number of bytes to be written. Optional.ReturnThe fwrite() function returns the number of bytes written on success, whereas returns False on failure.ExampleOutput20

Advertisements