Common php code, hash, split, unset [sizelarge] & lt ;? Php *** @ author * @ version $ Id $ * This php file uses the functions required for most data processing. # Error_reporting (ALL); # $ dbtdbm_popen (. id. words. tdb common php code, hash, split, unset
[Size = large]
40) # return; # echo $ line = preg_replace ("/\ n/", "", $ line); # echo $ line; $ arr = explode ("", $ line); if (count ($ arr) <2) continue; $ query = $ arr [0]; $ ids = $ arr [1]; $ arrID = explode ("", $ ids); $ len = count ($ arrID); $ str = ""; unset ($ hash); for ($ I = 0; $ I <$ len; $ I ++) {$ title = getTitle ($ db, $ arrID [$ I]); $ words = explode ("", $ title ); foreach ($ words as $ word) {// echo $ word; // determine if it is in the hash dictionary if (isset ($ hash [$ word]) {$ Hash [$ word] = $ hash [$ word] + 1;} else {$ hash [$ word] = 1 ;}}$ I = 0; // traverse the hash data structure foreach ($ hash as $ key => $ val) {if ($ I = 0) {$ str = $ key. "\ x03 ". $ val; $ I = 1;} else {$ str = $ str. "\ x02 ". $ key. "\ x03 ". $ val ;}// string concatenation echo "qf ". $ query. "\ x01 ". $ str. "\ n" ;}fclose ($ file_handle);?>
[/Size]