|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Read the Html file From PHP
HI I am a new user
I stored a Script(HTML/PHP/Javascript Code) code That is Generated by my other PHP script into Text file . now i want to show that code to user as it is (including HTML tages) using PHP How To do it? I write a Following PHP code <?php $filename = "temp.txt"; $fp = fopen($filename, "r"); $contents = fread($fp, filesize($filename)); fclose($fp); echo $contents; ?> my txt file content are: <?php // Remember to copy files in misc/samples/xmlrpc/php to the same directory as your script require('lib-xmlrpc-class.inc.php'); $xmlrpcbanner = new phpAds_XmlRpc('127.0.0.1', '/phpadsnew'); $xmlrpcbanner->view('', 11, '', '', '0'); ?> I get Following Output: view(\'\', 11, \'\', \'\', \'0\'); ?> I want to Get a complet file As it is How to do it? PRavin Dabhade |
|
#2
|
|||
|
|||
|
this will solve u r problem
<?php
// Get a file into an array. In this example we'll go through HTTP to get // the HTML source of a URL. $lines = file('script.txt'); // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num => $line) { echo htmlspecialchars($line) . "<br />\n"; } // Another example, let's get a web page into a string. See also file_get_contents(). //$html = implode('', file('http://www.example.com/')); ?> |
|
#3
|
|||
|
|||
|
Can we do the same thing to read the PHP file.....
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Read the Html file From PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|