运行 ❯
获取你自己的
PHP
服务器
×
更改方向
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <?php $str = "The rain in SPAIN falls mainly on the plains."; $pattern = "/ain/i"; if(preg_match_all($pattern, $str, $matches)) { print_r($matches); } ?> </body> </html>
Array ( [0] => Array ( [0] => ain [1] => AIN [2] => ain [3] => ain ) )