PHP (WORK)

xiaoxiao2021-03-06  52

Add the following in the beginning of the PHP page

$ TIME_START = Getmicrotime ();

Function getmicrotime ()

{

List ($ Uses $ sec) = expedition ("", microtime ());

Return (FLOAT) $ uEC (FLOAT) $ sec);

}

?>

Then add the following code to finally

$ TIME_END = Getmicrotime ();

Printf ("[[[page execution time:% .2F milliseconds] / n / n", ($ TIME_END - $ TIME_START) * 1000);

?>

$ file = fopen ($ filename, 'r') or Die ("Sorry, you can't open: $ filename");

OR is understood here because it does not distinguish between the data type in PHP, so File can be both int or Bool, so this statement does not report error. But the process may not understand some friends. In fact, in most languages, BOOL OR BOOL has a statement such if the previous value is true after a value, it will not be judged. It is also, so if the FOPEN function is executed correctly, it will return a more than 0 int value (this is actually "true"), and the following statement will not be executed. If the Fopen function failed, it will return false, then it is true if it is judged whether it is true. The result is performed after Die (), no matter what is returned, the program has stopped executing, and the specified error message is displayed, and the purpose of debugging is achieved.

PHP check box problem

111 222 333 4444 555 6666 d.php ";> PHP code in front of the function in front of the function What do you mean?

@ The role is to ignore the error message generated when the call is called.

Problems added in PHP

$ FORM_VOTE_EXPIREDAY = 31;

$ newTime = Date ("Y-m-D", MKTIME (0, 0, 0, Date ("M"), Date ("D") $ FORM_VOTE_EXPIREDAY, DATE ("Y")))))

Problems about PHP watermark

ImageDestroy ($ IM); ImageDestroy ($ IM1);?>

// Program Writen by sadly www.phpx.com function GB2UTF8 ($ GB) {if (! Trim ($ GB)) Return $ GB; $ filename = "gb2312.txt /"; $ tmp = file ($ filename); $ CODETABLE = array (); while ($ key, $ value) = Each ($ TMP)) $ CODETABLE [HEXDEC (Substr ($ Value, 0, 6))] = SUBSTR ($ Value, 7, 6) $ UTF8 = / "/"; while ($ GB) {if (ORD (Substr ($ GB, 0, 1))> 127) {$ this = SUBSTR ($ GB, 0, 2); $ GB = Substr ($ GB, 2, Strlen ($ GB)); $ UTF8. = U2UTF8 (HEXDEC ($ CODETABLE [HEXDEC (BIN2HEX ($ this)) - 0x8080]));} else {$ GB = Substr ($ GB, 1 Strlen ($ GB)); $ UTF8. = U2UTF8 (Substr ($ GB, 0, 1));}}}}} $ RET = / "/"; for ($ I = 0; $ I > 6 ); $ Str. = (0x80 | $ C & 0x3f);} else if ($ c <0x10000) {$ Str. = (0xE0 | $ C >> 12); $ Str. = (0x80 | $ c >> 6 & 0x3f); $ Str. = (0x80 | $ C & 0x3f);} else IF ($ C <0x200000) {$ Str. = (0xF0 | $ C >> 18); $ Str. = (0x80 | C >> 12 & 0x3f); $ Str. = (0x80 | $ C >> 6 & 0x3f); $ Str. = (0x80 | $ C & 0x3f);} r ETURN $ Str;} header (/ "content-type: image / gif /"); $ IM = ImageCreate (400); $ bkg = imagecolorallocate ($ IM, 0, 0); $ CLR = ImageColoralLocate ($ IM , 255, 255, 255); $ fnt = /"wb.ttf/ "; //include (/"gb2utf8.php/"); $ STR = GB2UTF8 (/ "China /"); ImageTfText ($ IM, 20, 0, 10 , 20, $ CLR, $ FNT, $ STR); ImageGIF ($ IM); ImageDestroy ($ IM);?>

// The code is as follows (file name "Test.php"): Switch ($ MON) {case '': echo 'Please select your constellation:'; break; case '1': echo 'Your constellation is aquarius '; Break; Case' 2 ': echo' Your constellation is a Pisces'; Break; Case '3': Echo 'Your constellation is Aries'; Break; Case' 4 ': Echo' Your constellation is Jin Bull '; Break; Case '5': Echo 'Your constellation is a double son'; Break; Case '6': echo 'Your constellation is a Cancer'; Break; Case '7': echo 'Your constellation is Leo'; Break; Case '8': Echo 'Your constellation is Virgo'; Break; Case '9': Echo 'Your constellation is the skypower'; Break; Case '10': echo 'Your constellation is Scorpio'; Break; Case '11': echo 'Your constellation is a shooter'; Break; Case '12': echo 'Your constellation is a magic side'; Break; default: Break;}?>