2014-02-27 140 views
0

要简单PHP的preg_match不显示

$stringData = file_get_contents('testtext.txt');  
$regular='/beginning "(.*?)"end/ueU'; 
preg_match($regular, $stringData,$match); 
echo $match[0]; 

只是为了得到“字符串和”开头的字符串之间的字符串结束

结果括号及其结果字符串的内容是这样的:

会员团体活动RSS标题 - “[网站名称] | [用户显示#名称] |团体活动

但文字是(我想要得到的一切):

</strong> and <strong>member groups activity RSS title - "[Site Name] | [User Display] 
<[email protected]> #. Name] | Groups Activity 

它不显示括号,并在

任何帮助wiould得到很好的理解

回答

2

这就是HTML是如何在浏览器中呈现在结果字符串中的括号<>全文:

echo htmlentities($match[0]);