鑵捐php闈㈣瘯棰樼洰璁粌


涓銆丳HP寮鍙戦儴鍒

1锛庡悎骞朵袱涓暟缁勬湁鍑犵鏂瑰紡锛岃瘯姣旇緝瀹冧滑鐨勫紓鍚

2锛庤鍐欎竴涓嚱鏁版潵妫鏌ョ敤鎴锋彁浜ょ殑鏁版嵁鏄惁涓烘暣鏁帮紙涓嶅尯鍒嗘暟鎹被鍨嬶紝鍙互涓轰簩杩涘埗銆佸叓杩涘埗銆佸崄杩涘埗銆佸崄鍏繘鍒舵暟瀛楋級

3锛嶱HP鐨剆trtolower()鍜宻trtoupper()鍑芥暟鍦ㄥ畨瑁呴潪涓枃绯荤粺鐨勬湇鍔″櫒涓嬪彲鑳戒細瀵艰嚧灏嗘眽瀛楄浆鎹负涔辩爜锛岃鍐欎袱涓浛浠g殑鍑芥暟瀹炵幇鍏煎Unicode鏂囧瓧鐨勫瓧绗︿覆澶у皬鍐欒浆鎹

4锛嶱HP鐨刬s_writeable()鍑芥暟瀛樺湪Bug锛屾棤娉曞噯纭垽鏂竴涓洰褰/鏂囦欢鏄惁鍙啓锛岃鍐欎竴涓嚱鏁版潵鍒ゆ柇鐩綍/鏂囦欢鏄惁缁濆鍙啓

5锛嶱HP鐨刢hmod()鍑芥暟瀛樺湪Bug锛屾棤娉曚繚璇佽缃垚鍔燂紝璇峰啓涓涓嚱鏁板湪鎸囧畾璺緞涓嬪垱寤轰竴涓洰褰/鏂囦欢骞剁‘淇濆彲浠ユ纭缃潈闄愭帺鐮

6锛嶱HP澶勭悊涓婁紶鏂囦欢淇℃伅鏁扮粍涓殑鏂囦欢绫诲瀷$_FILES[‘type’]鐢卞鎴风娴忚鍣ㄦ彁渚涳紝鏈夊彲鑳芥槸榛戝浼犵殑淇℃伅锛岃鍐欎竴涓嚱鏁版潵纭繚鐢ㄦ埛涓婁紶鐨勫浘鍍忔枃浠剁被鍨嬬湡瀹炲彲闈

7锛嶱HP閫氳繃瀵规暟鎹殑URL缂栫爜鏉ュ疄鐜颁笌Javascript鐨勬暟鎹氦浜掞紝浣嗘槸瀵逛簬閮ㄥ垎鐗规畩瀛楃鐨勭紪瑙g爜涓嶫avascript鐨勮鍒欎笉灏界浉鍚岋紝璇峰叿浣撹鏄庤繖绉嶅樊寮傦紝骞堕拡瀵筓TF-8瀛楃闆嗙殑鏁版嵁锛屽啓鍑篜HP鐨勭紪瑙g爜鍑芥暟鍜孞avascript鐨勭紪瑙g爜鍑芥暟锛岀‘淇漃HP缂栫爜鏁版嵁鍙互琚獼avascript姝g‘瑙g爜 銆丣avascript缂栫爜鐨勬暟鎹彲浠ヨPHP姝g‘瑙g爜

8锛庤瘯闃愯堪Memcache鐨刱ey澶氳妭鐐瑰垎甯冪殑绠楁硶锛熷綋浠讳竴鑺傜偣鍑虹幇鏁呴殰鏃禤HP鐨凪emcache瀹㈡埛绔皢濡備綍澶勭疆锛熷浣曠‘淇滿emcache鏁版嵁璇诲啓鎿嶄綔鐨勫師瀛愭э紵

9锛庡浣曞疄鐜癙HP鐨勫畨鍏ㄦ渶澶у寲锛熸庢牱閬垮厤SQL娉ㄥ叆婕忔礊鍜孹SS璺ㄧ珯鑴氭湰鏀诲嚮婕忔礊锛

10锛庤璁捐涓涓暟鎹粨鏋勫彲浠ュ疄鐜版棤闄愮骇瀛愯彍鍗曠殑鏍戝瀷鑿滃崟鍔熻兘骞舵彁渚涜彍鍗曠敓鎴愮畻娉曪紝鐢║ML鎻忚堪璁捐骞跺啓鍑虹浉鍏砅HP浠g爜


涓. array_combine()锛岃嫳鏂囬噷闈㈢殑combine鏈夌粨鍚堢殑鎰忔濓紝灏嗕袱涓暟缁撳悎骞舵垚涓涓柊鐨勬暟缁勶紝绗竴涓弬鏁颁负keys锛岀浜屼釜鍙傛暟涓簐alues;
array_merge()锛屽皢涓涓垨鑰呭涓暟缁勫悎骞舵垚涓轰竴涓暟缁勶紝濡傛灉keys涓烘暣鏁帮紝鍒欐柊鐨勬暟缁勫皢杩斿洖浠0寮濮嬬储寮曠殑鏁扮粍锛屽鏋滄暟缁勯噷闈㈡湁鐩稿悓鐨刱eys锛屽垯鍚庨潰鐨勮鐩栧墠闈㈢殑锛屼笌姝や笉鍚岀殑鏄array_merge_recursive;
array_merge_recursive锛屽叾浠栫殑绛夊悓浜array_merge,浣嗘槸鏁扮粍閲岄潰鏈夌浉鍚岀殑keys鐨勮瘽锛屼細鍚堝苟閫掑綊涓烘柊鐨勬暟缁;
浜. 鏈潵浠ヤ负鐢╥s_num灏卞彲浠ワ紝涓嶈繃浠旂粏涓鎯筹紝post杩囨潵鐨勬暟鎹槸char鏉ョ殑銆

if(!is_numeric($postn)||strpos($postn,鈥.鈥)!==false){
echo 鈥滀笉鏄暣鏁扳;
}else{
echo 鈥滄槸鏁存暟鈥;
}

涓.

function mystrtoupper($a){
    $b = str_split($a, 1);
    $r = '';
    foreach($b as $v){
        $v = ord($v);
        if($v >= 97 && $v<= 122){
            $v -= 32;
        }
//杞寲鎴恆scii鐮侊紝鐒跺悗鍑忓皯32灏辨槸灏忓啓杞ぇ鍐欙紝澧炲姞32灏辨槸澶у啓杞皬鍐
        $r .= chr($v);
    }
    return $r;
}
function mystrtolower($a){
    $b = str_split($a, 1);
    $r = '';
    foreach($b as $v){
        $v = ord($v);
        if($v >= 97 && $v<= 122){
            $v += 32;
        }
//鍙浆鍖栨垚ascii鐮侊紝鐒跺悗鍑忓皯32灏辨槸灏忓啓杞ぇ鍐欙紝澧炲姞32灏辨槸澶у啓杞皬鍐
        $r .= chr($v);
    }
    return $r;
}

鍥.

function is_really_writable($file)
    {
        // If we're on a Unix server with safe_mode off we call is_writable
        if (DIRECTORY_SEPARATOR == '/' AND @ini_get("safe_mode") == FALSE)
        {
            return is_writable($file);
        }

        // For windows servers and safe_mode "on" installations we'll actually
        // write a file then read it.  Bah...
        if (is_dir($file))
        {
            $file = rtrim($file, '/').'/'.md5(mt_rand(1,100).mt_rand(1,100));

            if (($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
            {
                return FALSE;
            }

            fclose($fp);
            @chmod($file, DIR_WRITE_MODE);
            @unlink($file);
            return TRUE;
        }
        elseif ( ! is_file($file) OR ($fp = @fopen($file, FOPEN_WRITE_CREATE)) === FALSE)
        {
            return FALSE;
        }

        fclose($fp);
        return TRUE;
    }

浜.涓嶇煡閬撴槸涓嶆槸鍥犱负璁剧疆浜嗘垚鍔熶笉鎴愬姛閮借繑鍥瀟rue鐨勫師鍥狅紝鏆傝繃銆
鍏.

$file = $_Files['file'];
if (getimagesize($file)){
    echo 'true';
} else{
    echo 'false';
//鍋囩殑鍥剧墖灏变細鏄剧ず涓洪敊璇
}

涓.

All posts

Other pages

鍙戣〃璇勮

鐢靛瓙閭欢鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞