
- PHP 7 Tutorial
- PHP 7 - Home
- PHP 7 - Introduction
- PHP 7 - Performance
- PHP 7 - Environment Setup
- PHP 7 - Scalar Type Declarations
- PHP 7 - Return Type Declarations
- PHP 7 - Null Coalescing Operator
- PHP 7 - Spaceship Operator
- PHP 7 - Constant Arrays
- PHP 7 - Anonymous Classes
- PHP 7 - Closure::call()
- PHP 7 - Filtered unserialize()
- PHP 7 - IntlChar
- PHP 7 - CSPRNG
- PHP 7 - Expectations
- PHP 7 - use Statement
- PHP 7 - Error Handling
- PHP 7 - Integer Division
- PHP 7 - Session Options
- PHP 7 - Deprecated Features
- PHP 7 - Removed Extensions & SAPIs
- PHP 7 Useful Resources
- PHP 7 - Quick Guide
- PHP 7 - Useful Resources
- PHP 7 - Discussion
PHP: How do I display the contents of a textfile on my page?
The file_get_contents function takes the name of the php file and reads the contents of the text file and displays it on the console. get the contents, and echo it out.
<?php echo file_get_contents( "filename.php" ); ?>
The contents of filename.php would be the output.
In the above code, the function ‘file_get_contents’ is called by passing the php file name. The output will be the contents present in the php file.
- Related Articles
- How do I redirect my web page with JavaScript?
- How can I increase the page rank of my website?
- How do I call a JavaScript function on page load?
- How to display array values with do while or for statement in my PHP?
- Get the Contents of a Web Page in a Shell Variable on Linux
- How do I create a Java string from the contents of a file?
- What are different Navigator properties I can use on my web page?
- How do I display an alert dialog on Android?
- How do I determine the size of my array in C#
- How do I display a list of objects based on a specific property with MongoDB?
- How do I display the indexes of a collection in MongoDB?
- Display the contents of a VIEW in MySQL?
- How do I find the location of my Python site-packages directory?
- How do I get rid of pimples on my face: using home remedies or medicinal ointments?
- How do I make my string comparison case insensitive?

Advertisements