PHP implements various classic algorithms
$ I; $ j --) {if ($ array [$ j] <$ array [$ j-1]) {$ tmp = $ array [$ j]; $ array [$ j] = $ array [$ j-1]; $ array [$ j-1] = $ tmp ;}}return $ array ;}// quick sort (array sorting) function quick_sort ($ array) {if (count ($ array) <= 1) return $ array; $ key = $ array [0]; $ left_arr = array (); $ right_arr = array (); for ($ I = 1; $ I
Strlen ($ str) return; if ($ length! = NULL) & ($ start> 0) & ($ length> strlen ($ str)-$ start) return; if ($ length! = NULL) & ($ start <0) & ($ length> strlen ($ str) + $ start) return; if ($ length = NULL) $ length = (strlen ($ str)-$ start); if ($ start <0) {for ($ I = (strlen ($ str) + $ start ); $ I <(strlen ($ str) + $ start + $ length); $ I ++) {$ substr. = $ str [$ I] ;}}if ($ length> 0) {for ($ I = $ start; $ I <($ start + $ length ); $ I ++) {$ substr. = $ str [$ I] ;}}if ($ length <0) {for ($ I = $ start; $ I <(strlen ($ str) + $ length ); $ I ++) {$ substr. = $ str [$ I] ;}return $ substr;} // string flip function strrev ($ str) {if ($ str = '') return 0; for ($ I = (strlen ($ str)-1); $ I> = 0; $ I --) {$ rev_str. = $ str [$ I];} return $ rev_str;} // string comparison function strcmp ($ s1, $ s2) {if (strlen ($ s1) <strlen ($ s2) return-1; if (strlen ($ s1)> strlen ($ s2) return 1; for ($ I = 0; $ I
(128) return false; for ($ I = 0; $ I
31 & $ c <107) $ c ++ = 20; if ($ c> 106 & $ c <127) $ c-= 75; $ word = chr ($ c); $ s. = $ word;} return $ s;} // simple decoding function (corresponding to the php_encode function) function php_decode ($ str) {if ($ str = ''& strlen ($ str)> 128) return false; for ($ I = 0; $ I
106 & $ c <127) $ c = $ C-20; if ($ c> 31 & $ c <107) $ c = $ c + 75; $ word = chr ($ c); $ s. = $ word;} return $ s;} // simple encryption function (corresponding to the php_decrypt function) function php_encrypt ($ str) {$ encrypt_key = 'abcdefghijklmnopqrstuvwxyz1234567890 '; $ decrypt_key = 'ngzqtcobmuhelkpdawxfyivrsj24680000059'; if (strlen ($ str) = 0) return false; for ($ I = 0; $ I