- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1466 Articles for PHP
163 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
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
199 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
56 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 ) )
35 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
157 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
143 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
432 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
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
To Continue Learning Please Login
Login with Google