我正在尝试/story.php?title=googlegoogle-google-google
从字符串中获取$cool
。获得它的唯一方法是使用多行正则表达式。我尝试了下面的代码,但没有奏效。谁能帮我这个?
<?php
$cool ='<li><span class="sidebar-vote-number"><a href="/story.php?title=gamestarts now">1</a></span><span class="sidebar-article"><a href="/story.php?title=googlegoogle-google-google" class="switchurl">GoogleGoogle Google Google</a></span></li>
Published News</a></div>
</div>
<div class="boxcontent">
<ul class="sidebar-stories">
<li><span class="sidebar-vote-number"><a href="/story.php?title=googlegoogle-google-google">1</a></span><span class="sidebar-article"><a href="/story.php?title=googlegoogle-google-google" class="switchurl">GoogleGoogle Google Google</a></span></li>';
preg_match('/Published News<\/a><\/div>
<\/div>
<div class="boxcontent">
<ul class="sidebar-stories">
<li><span class="sidebar-vote-number"><a href="(.*?)"/msU', $cool, $match);
echo $match[1];
?>