How to output the read html file as a character

Source: Internet
Author: User
How to output the read html file as a character! This post was last edited by storylok in 2014-01-0923: 20: 42 & lt ;! DOCTYPE & nbsp; html & nbsp; PUBLIC & nbsp; "-// How to output the read html file as a character!
This post was last edited by storylok at 23:20:42 on




Untitled Document



$ DocumentRoot = $ _ SERVER ['document _ root'];
$ A = readfile ("$ DocumentRoot/index-1.html ");
?>





I want to display the tag when the html file is output. After the current output, it is output according to the original meaning. I can use the following method to display it correctly. Is the readfile () function not capable of string output? Will he execute the prototype output?

If I use




Untitled Document




$ DocumentRoot = $ _ SERVER ['document _ root'];
$ A = fopen ("$ DocumentRoot/index-1.html", 'RB ');
While (! Feof ($ )){
$ Aa = fgets ($ a, 999 );
Echo $ aa;
}
?>



------ 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.