Example 1 Get and output the source of the homepage of a website. A URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide.
Submit a Pull Request Report a Bug. Parameters filename Name of the file to read. PHP Error. PHP Filesystem Functions. PHP Math Functions.
PHP String Functions. PHP Network Functions. PHP Gmagick Functions. PHP Imagick Functions. Table of Contents. Improve Article. Save Article. This function reads entire file source or part of it and returns as a PHP string data. This is most widely used function among other dedicated functions used for PHP file read. For example, file , fread and etc. Let us have two PHP programs for example of getting entire file content and some portion of the content, respectively.
Your message has been sent to W3Schools. W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use , cookie and privacy policy.
0コメント