发布于 2023-11-12 14:01:35 浏览 615 次
preg_match($pattern, $subject, $matches);
$string = "Hello, World!";$pattern = "/hello/i"; // i 表示不区分大小写if (preg_match($pattern, $string, $matches)) {echo "找到匹配的内容!";} else {echo "没有找到匹配的内容。";}