PHP Regex preg_match won't work


PHP Regex preg_match won't work

if (preg_match("/<response>(.*)<'/response>/iUms", '<response>CONNECTED_OK</response>', $mathces))
{
    var_dump($matches);
}

我试过这个,但起初我有一个下载的页面cURL与主题,我现在已经硬编码。我已经尝试了很多其他的东西,但它总是返回$匹配与null。

试试这个:

if (preg_match("/<response>(.*)<'/response>/iUms", '<response>CONNECTED_OK</response>', $matches)) { var_dump($matches); }

$mathces代替$matches