Home > Backend Development > PHP Tutorial > PHP: How to display the contents of a text file on my page?

PHP: How to display the contents of a text file on my page?

王林
Release: 2023-08-28 15:10:01
forward
1043 people have browsed it

PHP: How to display the contents of a text file on my page?

file_get_contents function gets the name of the php file and reads the contents of the text file and displays it on the console. Get the content and echo it. The contents of

<?php
   echo file_get_contents( "filename.php" );
?>
Copy after login

filename.php will be output.

In the above code, the function "file_get_contents" is called by passing the php file name. The output will be what exists in the php file.

The above is the detailed content of PHP: How to display the contents of a text file on my page?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template