搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
服务端开发
PHP 教程
PHP 高级教程
源代码
清空
点击运行
<?php $pattern = "/ca[kf]e/"; $text = "He was eating cake in the cafe."; if(preg_match($pattern, $text)){ echo "Match found!"; } else{ echo "Match not found."; } ?>
运行结果