개요
- 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
# )
같이 보기
- PHP preg_quote()
- PHP preg_match_all()
- PHP preg_replace()
- PHP preg_split()
- PHP preg_last_error()
- PHP배열 키 부분문자열 일치하는 항목만 뽑기
- 함수 preg_match()