I am trying to get /story.php?title=googlegoogle-google-google
from the string $cool
. The only way to get it is to use a multi-line regular expression. I tried the below code, but it didn't work. Can any one help me with this?
<?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];
?>