Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHP ÖÐ in_array º¯ÊýµÄÓ÷¨Óë×¢ÒâÏî

in_array(value,array,type)
in_array ×÷ÓÃÊÇÓÃÓڲ鿴 value ÊÇ·ñÔÚ array ÖдæÔÚ£¬Èç¹û²ÎÊý value ÊÇ×Ö·û´®£¬ÇÒ type ²ÎÊýÉèÖÃΪ true£¬ÔòËÑË÷Çø·Ö´óСд¡£Ôò in_array ÊÇ Çø·Ö´óСд µÄ¡£
ÓÐÒ»µãÐèҪעÒ⣬µ± array Öаüº¬ value µÄÖµ£¬Ôò·µ»Ø true£» µ«ÊÇ£¬Èç¹ûÁ½Õß²ÎÊýÖ®¼äÏàµÈ£¬Ôò·µ»Ø false
ÀýÈ磺
$str = 'a';
$arr = array('a','b','c');
if( in_array($str,$arr) ){
echo "°üº¬..";
}else{
echo '²»°üº¬..';
}

ÉÏÃæµÄ´úÂëÔËÐÐºó·µ»Ø “°üº¬” Ò²¾ÍÊÇ true£¬ÒòΪ $str ÖÐÓÐ $arr µÄÖµ¡¢´óСдҲһÑù£¬×îÖØÒªµÄÊÇÁ½Õß²ÎÊý²»ÏàµÈ£¡
ÔÙÀ´£¬ÎÒÃÇ»»¸ö´úÂë¡£
$str = array('a','b','c');
$arr = array('a','b','c');
if( in_array($str,$arr) ){
echo "°üº¬..";
}else{
echo '²»°üº¬..';
}

Õâ´Î¾Í·µ»Ø²»°üº¬ÁË£¬ËùÒÔÎÒÖ»ÄÜÀí½âΪ Ö»ÄÜ $arr Öаüº¬ $str£¬²»ÄÜÏàµÈ»ò³¬Ô½¡£
ÄÇôÐÞ¸ÄÏ¡£
$str = array('a','b','c');
$arr = array(
array('a','b','c'),
array('d','e','f')
);
if( in_array($str,$arr) ){
echo "°üº¬..";
}else{
echo '²»°üº¬..';
}
ÐÂÊֱʼǣ¬¾­¹©²Î¿¼£¬Èç¹û´íÎó£¬ÇëÖ¸Õý£¡


Ïà¹ØÎĵµ£º

PHPʵÏÖÎļþµÄ¶ÁºÍд¹¦ÄÜ

½øÐÐÎļþµÄ¶ÁºÍд£¬ÏÈ´ò¿ªÒ»¸öÎļþ£¬È»ºó¿ªÊ¼¶Á»òÕßдÎļþ£¬×îºóÔÙ¹ØϵÕâ¸öÎļþ×ÊÔ´¡£
È磬ÎļþµÄ¶Á²Ù×÷£º
<?php
$file = fopen('your file path','r');
while(!feof($file)){ //µ±Ã»ÓжÁÈ¡µ½Îļþ½á⣬¼ÌÐøÑ­»·¶ÁÈ¡²Ù×÷
$line = fgets($file); //¶ÁÈ¡µ½Ò»ÐеÄÄÚÈÝ
echo $line.'<br/>';
}
fclose($file) ......

phpÄ£°å×ܽá

“Ä£°åÕⶫÎ÷,Æäʵ×îÖØÒªµÄÊÇÊʺÏ×Ô¼ºµÄÏîÄ¿ÐèÇó,¶ø²»ÊÇÊʺÏ×Ô¼ºµÄÏ°¹ß.±ÈÈçÒ»¸öÆóÒµµÄÐû´«ÍøÕ¾,·ÃÎÊÁ¿²»´ó,¸üÐÂÁ¿Ò²²»´ó,ÓÃʲô¶¼Ò»Ñù,ÉõÖÁ²»ÓÃ,
Ö±½ÓPHP+HTMLд¿ÉÄÜËÙ¶È×î¿ì.Ҳûʲô²»¿É.µ«ÊÇÈç¹ûÊÇÒ»¸öÐÂÎÅϵͳ,»òÕßÊÇÄÚÈÝ·¢²¼ÏµÍ³.Á½ÕßÕâÑù,¾Í·Ç³£ÓбØÒªÓõ½Ä£°åÕâÒ»¼¼Êõ.ÒòΪËûÃǶ¼
ÓÐÒ»¸ö¹²Í¨µÄµØ·½,¾ÍÊÇÓÐÒ» ......

PHP»ñȡijÄêµÚ¼¸ÖܵÂÆðʼÖÕÖ¹ÈÕÆÚ

·ÀÖ¹ÒÔºóÍüµô£¬ÌùÔÚÕâ¶ùÀ²
 function GetWeekDate($week,$year)
 {
       $timestamp = mktime(0,0,0,1,1,$year);
       $dayofweek = date("w",$timestamp);
       if( $week != 1)
   &nb ......

PHPÎļþ°üº¬Â©¶´Ô­Àí·ÖÎöºÍÀûÓ÷½·¨


                 PHPÎļþ°üº¬Â©¶´Ô­Àí·ÖÎöºÍÀûÓ÷½·¨
±¾ÎÄÕ¼òµ¥ÕªÒª£ºÒ»¡¢Éæ¼°µ½µÄΣÏÕº¯Êý¡²include(),require()ºÍinclude_once(),require_once()¡³ include()&&require()Óï¾ä:°üÀ¨²¢ÔËÐÐÖ¸¶¨Îļþ¡£ÕâÁ½Öֽṹ³ýÁËÔÚÈçºÎ´¦ ......

»ùÓÚPHPµÄÐÂWeb¿ª·¢¿ò¼Ü

±¾ÎÄת×Ô:http://www.msphome.cn/post/119/
    ×î½üÒòΪҪ¶ÔÒ»¸öÏîÄ¿½øÐÐÖع¹£¬ËùÒÔÒ»Ö±ÔÚÑо¿PHP¿ò¼Ü¡£´óÌå¿´ÁË¿´Zend Frameworks£¬×ÐϸѧϰÁËÏÂsymfony£¬·¢ÏÖÒ»¸öÁ¼ºÃµÄMVC Web¿ò¼Ü£¬×ãÒԸı俪·¢Ï°¹ß¡£µ«ÊÇÎÞÂÛÊÇZend Frameworks»¹ÊÇsymfony£¬¶ÔÓÚÖÐСÐÍÏîÄ¿µÄ¿ª·¢À´Ëµ¶¼¹ýÓÚÓ·Ö×£¬²¢²»ÄܺܺõÄÌáÉý¿ª· ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ