پی ایچ پی فائل پروسیسنگ
- Previous Page PHP Include
- Next Page PHP File Open/Read
PHP ਦਾ ਫਾਈਲ ਚਲਾਉਣਾ
PHP ਨੇ ਫਾਈਲ ਬਣਾਉਣ, ਪੜ੍ਹਨ, ਅਪਲੋਡ ਅਤੇ ਸੋਧਣ ਲਈ ਕਈ ਫੰਕਸ਼ਨ ਹਨ。
ਧਿਆਨ:ਫਾਈਲ ਦਾ ਇਸਤੇਮਾਲ ਕਰਦੇ ਸਮੇਂ ਧਿਆਨ ਰੱਖੋ!
ਤੁਸੀਂ ਫਾਈਲ ਚਲਾਉਂਦੇ ਸਮੇਂ ਬਹੁਤ ਧਿਆਨ ਰੱਖਣਾ ਚਾਹੀਦਾ ਹੈ। ਤੁਸੀਂ ਗਲਤੀ ਕਰਨ ਤਾਂ ਬਹੁਤ ਗੰਭੀਰ ਨੁਕਸਾਨ ਹੋ ਸਕਦਾ ਹੈ। ਮਿਸਾਲੀ ਗਲਤੀਆਂ ਹਨ:
- Edit Error in File
- Hard Drive Filled with Garbage Data
- Accidentally Deleted File Content
PHP readfile() Function
The readfile() function reads the file and writes it to the output buffer.
Assuming we have a text file named "webdictionary.txt" stored on the server, like this:
AJAX = Asynchronous JavaScript and XML CSS = Cascading Style Sheets HTML = Hyper Text Markup Language PHP = PHP Hypertext Preprocessor SQL = Structured Query Language SVG = Scalable Vector Graphics XML = EXtensible Markup Language
The PHP code to read this file and write to the output stream is as follows (if read successfully, the readfile() function returns the number of bytes):
Example
<?php echo readfile("webdictionary.txt"); ?>
If all you want to do is open a file and read the content of the reader, then the readfile() function is very useful.
The next section will explain more about file handling.
PHP Filesystem Reference Manual
For a complete PHP Filesystem Reference Manual, please visit the one provided by CodeW3C.com PHP Filesystem Reference Manual.
- Previous Page PHP Include
- Next Page PHP File Open/Read