Found 1466 Articles for PHP

rmdir() function in PHP

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

157 Views

The rmdir() function removes an empty directory. With that, the file must have the relevant permissions required to delete the directory.Syntaxrmdir(dir, context)Parametersrmdir − The directory to be removed.context − Specify the behavior of the stream.ReturnThe rmdir() function returns True on success or False on failure.ExampleOutputTRUELet us see another example.ExampleOutputTRUE

rewind() function in PHP

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

78 Views

The rewind() function rewinds a file pointer. It moves it to the beginning of the file. It returns True on success or False on failure. Syntax rewind(file_pointer) Parameters file_pointer − It must point to a file opened by fopen() Return The rewind() function returns True on success or False on failure. Example $file_pointer = fopen("new.txt", "r"); // Position of the file pointer is changed fseek($file_pointer, "12"); // Setting the file pointer to the beginning of the file rewind($file_pointer); fclose($file_pointer); Output TRUE

rename() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:30:58

197 Views

The rename() function renames a file or directory. The function returns TRUE on success or FALSE on failure.Syntaxrename(old_filename, new_filename, context)Parametersold_filename − The old name of the file or directory.new_filename − The new name of the file or directory.context − Specify the behaviour of the stream.ReturnThe rename() function returns TRUE on success or FALSE on failure.ExampleOutputTRUELet us see another example.ExampleOutputTRUE

realpath_cache_size() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:31:33

46 Views

The realpath_cache_size() function returns realpath cache size i.e. the amount of memory.Syntaxrealpath_cache_size()ParametersNAReturnThe realpath_cache_size() function returns the amount of memory realpath cache is using.Example Live DemoOutput362

realpath_cache_get() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:31:52

53 Views

The realpath_cache_get() function returns realpath cache entries. It returns an array of realpath cache entries.Syntaxrealpath_cache_get()ParametersNAReturnThe realpath_cache_get() function returns an array of realpath cache entries.Example Live DemoOutputArray ( [/home] => Array ( [key] => 4353355791257440477 [is_dir] => 1 [realpath] => /home [expires] => 1538630044 ) [/home/cg/root] => Array ( [key] => 1131813419205508649 [is_dir] => 1 [realpath] => /home/cg/root [expires] => 1538630044 ) [/home/cg/root/8944881/main.php] => Array ( [key] => 584844883037958768 [is_dir] => [realpath] => /home/cg/root/8944881/main.php [expires] => 1538630044 ) [/home/cg] => Array ( [key] => 9037225891674879750 [is_dir] => 1 [realpath] => /home/cg [expires] => 1538630044 ) [/home/cg/root/8944881] => Array ( [key] => 722006552431300374 [is_dir] => 1 [realpath] => /home/cg/root/8944881 [expires] => 1538630044 ) )

realpath() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:32:13

34 Views

The realpath() function returns the absolute pathname. It returns the absolute pathname on success and False on failure.Syntaxrealpath(path)Parameterspath − The path to check. Required.ReturnThe realpath() function returns the absolute pathname on success and False on failure.ExampleOutputD:\tutorials\javaew.txt

readlink() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:32:35

155 Views

The readlink() function returns the target of a symbolic link. It returns the contents of the symbolic link path, else returns FALSE on error.Syntaxreadlink(path)Parameterspath − The path of the symbolic linkReturnThe readlink() function returns the contents of the symbolic link path. It returns FALSE on error.Example

readfile() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:32:58

137 Views

The readfile() function read a file and writes it to the output buffer.Syntaxreadfile(file_path, include_path, context)Parametersfile_path − The path of the fileinclude_path − Set this parameter to TRUE, if you want to search for the file in the include_pathcontext − Specifies the behavior of the stream.ReturnThe readfile() function returns the number of bytes read from the file.ExampleThe following is the output that returns the number of bytes.OutputThis is demo text! 18

popen() function in PHP

Samual Sam
Updated on 24-Jun-2020 09:24:03

425 Views

The popen() function opens a pipe. It can be used with fgets(), fgetss(), and fwrite(). The file pointer initiated by the popen() function must be closed with pclose().Syntaxpopen(command, mode)Parameterscommand − Set the command to be executedmode − Set the mode, such as “r”, “w”, etc.ReturnThe popen() function returns TRUE on success. It returns FALSE if an error occurs.ExampleOutputTRUELet us see another example.ExampleOutputTRUE

pclose() function in PHP

karthikeya Boyini
Updated on 24-Jun-2020 09:24:27

78 Views

The pclose() function closes a pipe opened by popen(). It returns the termination status of the process that was run. In case of an error -1 is returned.Syntaxpclose(file_pointer)Parametersfile_pointer − Specifies the pipeReturnThe pclose() function returns the termination status of the process that was run. In case of an error -1 is returned.ExampleOutputTRUELet us see another example.ExampleOutputTRUE

Advertisements