這個(gè)$matches是怎么來的?
$subject = "my email is spark@imooc.com";
$pattern = '/[\w\-]+@\w+\.\w+/';
preg_match($pattern, $subject, $matches);
echo $matches[0];
這個(gè)$matches是怎么來的?
$subject = "my email is spark@imooc.com";
$pattern = '/[\w\-]+@\w+\.\w+/';
preg_match($pattern, $subject, $matches);
echo $matches[0];
這個(gè)$matches是怎么來的?
2014-11-11
舉報(bào)
2014-11-17
建議你下載一下這個(gè)課程源碼下載區(qū)的《PHP學(xué)習(xí)手冊(cè)》,查找一下preg_match這個(gè)函數(shù)的使用方法,你自然而然就知道$matches是怎么來的了,祝學(xué)習(xí)愉快^_^!