How to output a read-in HTML file as a character

Source: Internet
Author: User
Tags readfile
How to output a read-in HTML file as a character!
This post was last edited by Storylok on 2014-01-09 23:20:42





Untitled Document



$DocumentRoot = $_server[' document_root ');
$a = ReadFile ("$DocumentRoot/index-1.html");
?>
<?php echo $a;?>




I want the HTML file to be read in the output to show how the tag is done. The output is now output in accordance with the original meaning. I use the following method to display correctly. is the ReadFile () function not a string output? Will he perform prototype output?

If I use




Untitled Document



<br/><?php<br/> $DocumentRoot = $_server[' document_root '];<br/> $a = fopen ("$DocumentRoot/ Index-1.html ", ' RB '); <br/>while (!feof ($a)) {<br/> $aa = fgets ($a, 999); <br/>echo $aa; <br/>} <BR/>?>



------Solution--------------------
 
  $new = Htmlspecialchars ("Test", ent_quotes);
Echo $new;
?>
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.