How to compare dates and display records within 5 days
Source: Internet
Author: User
I can see that many websites have the instant simple and traditional switching function, but no one provides the practice. Therefore, I also wrote a conversion program for anyone who needs it: the table file used by the following program is big5 of a4chinese. it shows that many websites have the function of switching between simple and traditional in real time, but no one provides the method. Therefore, I also wrote a conversion program, for reference:
The table file used by the following program is the big5-gb.table of a4chinese, its copyright is owned by a4chinese; PHP code part can be freely modified application, only cannot sell for profit .. ^
1. get the big5-gb.table file first, you can find it at the URL below
Http://netcity.hinet.net/kstchieh/table.zip
2. add the following PHP code:
Function big52gb ($ Text ){
$ Fp = fopen ("big5-gb.table", "r ");
$ Max = strlen ($ Text)-1;
For ($ I = 0; $ I <$ max; $ I ++ ){
$ H = ord ($ Text [$ I]);
If ($ h> = 160 ){
$ L = ord ($ Text [$ I + 1]);
If ($ h = 161 & $ l = 64 ){
$ Gb = "";
} Else {
Fseek ($ fp, ($ h-160) * 510 + ($ L-1) * 2 );
$ Gb = fread ($ fp, 2 );
}
$ Text [$ I] = $ gb [0];
$ Text [$ I + 1] = $ gb [1];
$ I ++;
}
}
Fclose ($ fp );
Return $ Text;
}
3. then you can use it.
$ A = "traditional to simplified ";
$ A = big52gb ($ );
The above code is the simplest method, that is, one by one, and the speed is acceptable. if you want to hurry up, you need to rewrite the method (I am not using this method, however, because my method is still being tested and I still don't know the stability and instability, I haven't written it out yet )... ^
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