PHP preg_match()

(Preg match에서 넘어옴)

1 개요[ | ]

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

2 같이 보기[ | ]

3 참고[ | ]