

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- 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 do I create a Java string from the contents of a file?
- How do I display an alert dialog on Android?
- What are different Navigator properties I can use on my web page?
- How do I determine the size of my array in C#
- Display the contents of a VIEW in MySQL?
- How do I display the indexes of a collection in MongoDB?
- How do I display a list of objects based on a specific property with MongoDB?
- How to display array values with do while or for statement in my PHP?
- 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 let my Matplotlib plot go beyond the axes?
- How do I make my string comparison case insensitive?
Advertisements