1: If the page is open garbled, don't worry, do not do any editing. Remember。 2: Then click the menu to Modify-"page Properties-" title/code 3: In the Code select Simplified Chinese (gb2321) 4: Click Reload-"OK"
Create a new Notepad (not a clipboard!) , and then copy the file that you want to read into this Notepad file and save it. Use the following code to read the Notepad file 1303275.txt: found that when the page is encoded as gb2312 all normal display. Changed to UTF8 code, the number is normal, Chinese characters for garbled, which also belong to the normal
<?php Tutorial $file = fopen ("1303275.txt", "R");//read-only Open text file while (! feof ($file))//When file does not end { $line =fgets ($file);//read one line to $line variable Echo $line. <br/> "; } Fclose ($file);//Close text file
?> The above method is more stupid but also solves the problem, below I provide a no matter what txt text will not disorderly solution.
/* @params $str input character $type need to get the encoding @author Long Line */ function Autoiconv ($str, $type = "Gb2312//ignore") {
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.