¹øÈ£ |
Á¦¸ñPage 1192/5686 |
±Û¾´ÀÌ |
³¯Â¥ |
Á¶È¸ |
̵̧ |
|
(±¤°í) ´ÜÅë¹ý ½Ã´ëÀÇ ÀÎÅͳݰ¡ÀÔ °¡À̵å(ver2.0) (228) |
¹é¸Þ°¡ |
2015-12 |
1507185 |
25 |
2015-12
1507185
1 ¹é¸Þ°¡
|
|
[Çʵ¶] óÀ½ ¿À½Ã´Â ºÐÀ» À§ÇÑ ¾È³» (727) |
Á¤ÀºÁØ1 |
2014-05 |
4970862 |
0 |
2014-05
4970862
1 Á¤ÀºÁØ1
|
89882 |
<°Ô½ÃÆÇÀ̵¿> ÀÚµ¿Â÷¿¡¼ 9v Àü¿øÀ» ¾²´Â ¹æ¹ý? (13) |
Á¤ÀǼ® |
2018-12 |
4111 |
0 |
2018-12
4111
1 Á¤ÀǼ®
|
89881 |
Çϵåµð½ºÅ© 1TB Áö¿ø¿¡ °üÇØ (4) |
¿À¼®±¸ |
2008-11 |
5062 |
3 |
2008-11
5062
1 ¿À¼®±¸
|
89880 |
VGAÄ«µå PCIÀÏ¹Ý ºê¶óÄÏ ±¸ÀÔó¸¦ ¹®Àǵ帳´Ï´Ù. (6) |
classiccha |
2012-03 |
6376 |
0 |
2012-03
6376
1 classiccha
|
89879 |
À¯´Ð½º ½ºÅ©¸° ĸÃÄ -> À©µµ¿ì¿¡¼ º¸±â (9) |
winner712 |
2017-09 |
3925 |
0 |
2017-09
3925
1 winner712
|
89878 |
Ç㸮 ÇùÂøÁõ ½Ã¼ú ÀßÇϴ°÷ Ãßõ ºÎŹÇØ¿ä~~ (7) |
¿£ºñ |
2015-08 |
20507 |
0 |
2015-08
20507
1 ¿£ºñ
|
89877 |
ÀÚ¹Ù println ±âÃÊÀûÀΰŠÁú¹®µå·Á¿ä. (2) |
inquisitive |
2017-09 |
3245 |
0 |
2017-09
3245
1 inquisitive
|
89876 |
º¸µå¿¡¼ ³ª¿À´Â USBÄÉÀ̺íÀÌ Âª¾Æ¿ä. |
ÀÌ»ó¸ñ |
2003-02 |
12227 |
93 |
2003-02
12227
1 ÀÌ»ó¸ñ
|
89875 |
¿¢¼¿ ÆÄÀÏÀÌ À̸® ¹«°Å¿ï¼ö°¡ ÀÖ³ª¿ä? ¤Ð¤Ð (15) |
¸¶ÇÏÀǼӵµ |
2018-12 |
8573 |
0 |
2018-12
8573
1 ¸¶ÇÏÀǼӵµ
|
89874 |
¼¹ö¿ëÀ¸·Î PC¸¦ Á¶¸³ÇÏ·ÁÇϴµ¥ ¿ø°Ý°ü¸®±â´ÉÀÌ ³»ÀåµÈ ¸ÞÀκ¸µå°¡ ÀÖÀ»±î¿ä? (2) |
¹Ú¿µ¼± |
2008-12 |
5041 |
3 |
2008-12
5041
1 ¹Ú¿µ¼±
|
89873 |
°³Á¶¹ÙÀÌ¿À½º¾÷µ¥ÀÌÆ® (1) |
PICT |
2015-08 |
3524 |
0 |
2015-08
3524
1 PICT
|
89872 |
¿À¶óŬ Sun Ray Software ´Ù¿î·Îµå °ü·Ã ¹®ÀÇ (2) |
ºü½Ã¿Â |
2018-12 |
2043 |
1 |
2018-12
2043
1 ºü½Ã¿Â
|
89871 |
Ƽ¹ÖÀÌ µÈ µà¾ó·£Ä«µå IP ÁÖ¼Ò´Â ¾î¶»°Ô Á¤ÇÒ ¼ö ÀÖÀ»±î¿ä? (4) |
VSPress |
2014-04 |
3781 |
0 |
2014-04
3781
1 VSPress
|
89870 |
DELL T5820¿¡ Àß ¸Â´Â 10±â°¡·£ Ä«µå ¹¹°¡ ÀÖÀ»±î¿ä? (7) |
VSPress |
2021-06 |
2725 |
0 |
2021-06
2725
1 VSPress
|
89869 |
SCSIDEºê¸´Áö,,,,,,,,, (4) |
±è¸í±Ô |
2003-02 |
12205 |
18 |
2003-02
12205
1 ±è¸í±Ô
|
89868 |
¿£ÅäÇǾư¡ ¾Æ´Ñ Àü¿ë¼±¿¡ ´ëÇØ Àß ¾Æ½Ã´ÂºÐ ´äº¯ ¹Ù¶ø´Ï´Ù (7) |
±è´ë¼º |
2009-01 |
4948 |
0 |
2009-01
4948
1 ±è´ë¼º
|
89867 |
±â°¡¹ÙÀÌÆ® ¸ÞÀκ¸µå¿¡ sur_cen Ä¿³ØÅÍ ¿¬°áºÎºÐ¿¡¼ aux_l, aux_rÀ̶ó´Â°Ç ½ºÅ×·¹¿À¡¦ (2) |
±è°Ç¿ì |
2015-08 |
4247 |
0 |
2015-08
4247
1 ±è°Ç¿ì
|
89866 |
ÀÎÅÚ 2¼¼´ë Á¦Ç°À̸é Çö¿ªÀ¸·Î º¼ ¼ö ÀÖÀ»±î¿ä? (13) |
³ªºñz |
2020-02 |
4809 |
0 |
2020-02
4809
1 ³ªºñz
|
89865 |
cpu ¿Âµµ °ü·Ã Áú¹® ÀÔ´Ï´Ù... (5) |
¹èµ¿°ü |
2005-11 |
4859 |
14 |
2005-11
4859
1 ¹èµ¿°ü
|
89864 |
ÀÎÅÚ ¼¹öº¸µå... s5000vsa.. ÆÒ ¾øÀÌ´Â »ç¿ë ºÒ°¡? (7) |
±èȲÁß |
2015-08 |
4883 |
0 |
2015-08
4883
1 ±èȲÁß
|
89863 |
hp Z420 À©µµ ¾ÏÈ£¸¦ ÇØÁ¦ÇÒ ¹æ¹ýÀÌ ÀÖ´ÂÁö¿ä? (13) |
¸Þ°¡³¯¹é |
2017-09 |
4846 |
0 |
2017-09
4846
1 ¸Þ°¡³¯¹é
|
case À¸·Î Çؼ
¸ÂÀ¸¸é break; ó¸®...
ÃÖÁ¾ÀûÀ¸·Î else µÇ¸é ¿¡·¯Ã³¸®...¤¾¤¾
case $name1: break;
case $name2: break;
case ($cname==$name3 || preg_match("/$cname\|+/", $name3) ? true : false): break;
default: echo "À߸øµÈ ȸ¿øÁ¤º¸ ÀÔ´Ï´Ù.";
}
´õ Á¤È®ÇÏ°Ô °íÃƽÀ´Ï´Ù.
case ¹®¿¡ preg_match¸¦ ³Ö¾î¼ ¾²´Â°ÍÀº ¿À´Ã ±¸±Û¸µÇؼ óÀ½ ÇغýÀ´Ï´Ù.¤¾¤¾
Á¶±Ý ¸Ó¸®¿¡ ¿ÀÌ ³µÁö¸¸ Àç¹Õ³×¿ä. ¤¾¤¾¤¾
https://stackoverflow.com/questions/38830349/preg-match-in-switch-case-in-php?noredirect=1&lq=1
Âü°íÇÑ ±ÛÀÔ´Ï´Ù.
¾Æ´Ï¸é $name1 $name2 $name3 À» ¹è¿º¯¼ö¿¡ ³Ö¾îµÎ°í
for ·çƾÀ¸·Î ó¸®Çؼ
ó¸®Çؼ continue ¸í·ÉÀ» »ç¿ëÇÏ´Â ¹æ¹ýµµ ÀÖ±ä Çѵ¥...
¾î¶»°Ô »ý°¢ÇÏ´ÂÁö¿ä?
ÇÔ¼öÈ ÇÏ¿© »ó´çÈ÷ ¹ßÀüµÈ °³³äÀ̳׿ä.
¤¾¤¾ °¨»çÇÕ´Ï´Ù.
¾ÈÀüÇÑ Á¶°ÇÀ» À§ÇØ === ±îÁö »ç¿ëÇϼ̳׿ä ... ±ÂÀÔ´Ï´Ù.
----------------------------------
$cname="È«±æµ¿¸¶½Ç";
$name1="°©¼øÀÌ";
$name2="¿¡¸¯°©µ¹ÀÌ";
$name3="È«±æµ¿¸¶½Ç||23.323.22";
$allow_arr=array($name1, $name2, $name3);
function check_user($check_name, $allow_arr) {
foreach ($allow_arr as $value) {
if ($value === $check_name || preg_match("/^$check_name\|+/", $value) ) return True;
}
return False;
}
if(!check_user($cname, $allow_arr)) echo "not exist!";
https://stackoverflow.com/questions/6433492/preg-match-vs-strpos-for-match-finding
Çߴµ¥ °á±¹ ½ÇÆÐÇß½À´Ï´Ù
ÀÌ¿ëÇÏ½Ã¸é µÇÁö ¾ÊÀ»±î¿ä..
$cname = "È«±æµ¿¸¶½Ç1";
$name=array();
$name[] = "°©¼øÀÌ";
$name[] = "¿¡¸¯°©µ¹ÀÌ";
$name[] = "È«±æµ¿¸¶½Ç||23.323.22";
$check_user = function($arr, $f) {$r=0;array_walk($arr,function(&$v)use(&$r,$f){if(strpos($v,$f) === 0)$r=1;});return $r;};
if (!$check_user($name, $cname)) echo "not exist!";
Àû¿ë½ÃÄѺ¸´Ï ±ò²ûÇÏ°Ô Àß ÀÛµ¿ÇÕ´Ï´Ù.
´õ±¸³ª preg_match¸¦ »ç¿ëÇÏÁö ¾Ê¾Æ ¼Óµµ¸é¿¡¼´Â ´õ ºü¸£°Ô ÀÛµ¿ÀÌ µÉ °ÍÀ¸·Î º¸ÀÔ´Ï´Ù.
function(&$v) ¶ó°í Áß°£¿¡ &À» ³Ö´Â °ÍÀº¹«¾ùÀ» ÀǹÌÇÏ´ÂÁö ÀüÇô ¸ð¸£°Ú½À´Ï´Ù. ¤Ð¤Ð
°¡²û Çѹø¾¿ º¸´Âµ¥... ±Ã±ÝÇß½À´Ï´Ù.
º¸Åë ÀÌ·± °æ¿ì´Â ±Û·Î¹ú º¯¼ö·Î ¼±¾ðÇؼ »ç¿ëÇÏ´ø°¡
¾Æ´Ï¸é ±×³É return Çش纯¼ö; ·Î Çؼ »ç¿ëÇϴµ¥...
´õ Æí¸®ÇÑ ¹æ¹ýÀ̷২ä.
$haystack = array (
'say hello',
'hello stackoverflow',
'hello world',
'foo bar bas'
);
$matches = preg_grep ('/^hello (\w+)/i', $haystack);
print_r ($matches);
¸¶Áö¸·¿¡ matches ÀÇ length ¸¦ ±¸Çؼ 0À̸é Àִ°Űí 1À̸é Àִ°ű¸¿ä.ÀÖÀ¸¸é array ·Î ¹Ýȯµµ µÇ±¸¿ä
preg_grep °¡ ÀÖ´Ù´Â »ç½ÇÀº óÀ½ ¾Ë¾Ò½À´Ï´Ù.
ÃæºÐÈ÷ ÀÌÇØ°¡ µÇ°í °ø°¨ÀÌ µË´Ï´Ù.
¸ÚÁ®¿ä.
Çѹø¾¿ ÄÚµù À̾߱⸦ ¿Ã¸±¶§¸¶´Ù ¾ÆÁÖ ´Ù¾çÇÑ ¼Ö·ç¼ÇÀº Á¤¸» ³î¶ø½À´Ï´Ù.
length ´Â
echo count($matches);¸¦ ¸»ÇÏ´Â °ÍÀÌ°ÚÁö¿ä