涓銆丳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';
//鍋囩殑鍥剧墖灏变細鏄剧ず涓洪敊璇
}
涓.
鍙戣〃鍥炲