"PHP preg match()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
3번째 줄: 3번째 줄:
;PHP preg_match()
;PHP preg_match()


<source lang='php'>
<syntaxhighlight lang='php'>
$subject = "abcdef";
$subject = "abcdef";
$pattern = '/^def/';
$pattern = '/^def/';
11번째 줄: 11번째 줄:
# (
# (
# )
# )
</source>
</syntaxhighlight>
<source lang='php'>
<syntaxhighlight lang='php'>
$subject = "defghi";
$subject = "defghi";
$pattern = '/^def/';
$pattern = '/^def/';
21번째 줄: 21번째 줄:
#    [0] => def
#    [0] => def
# )
# )
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

2020년 11월 2일 (월) 02:55 기준 최신판

1 개요[ | ]

PHP preg_match()
$subject = "abcdef";
$pattern = '/^def/';
preg_match($pattern, $subject, $matches);
print_r($matches);
# Array
# (
# )
$subject = "defghi";
$pattern = '/^def/';
preg_match($pattern, $subject, $matches);
print_r($matches);
# Array
# (
#     [0] => def
# )

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}