在此实例中,eregi()替换为什么?
// get value of text inbetween tags
function getContentByTag($tag1, $tag2, $string)
{
if (eregi("$tag1(.*)$tag2", $string, $out)) {
$outdata = $out[1];
}
return $outdata;
}这篇文章不是一个重复的文章,因为在引用的文章中的第三个例子中,答案是针对那个特定的用法的。我猜我的用法是不同的,因为引用的帖子答案对我不起作用。
发布于 2017-03-05 08:41:45
从PHP 7开始,您必须将其替换为
preg_match("/$tag1(.*)$tag2/i", $string, $out)https://stackoverflow.com/questions/42603088
复制相似问题