kevinkhan
11-02-2009, 02:03 PM
How come im not getting any results back for this code?
function getMatches($strMatch,$strContent) {
if(preg_match_all($strMatch,$strContent,$objMatches)){
return $objMatches;
}
return "";
}
$strContent = "<li class="tel"><strong>Tel: </strong><span><!-- sphoneid telnr="+353 (021)4501172" fileas="Abbey Business & Communications" -->(021)4501172<!-- sphoneid --></span></li>";
$strMatch = "<li class=\"tel\"><strong>Tel: </strong><span><!-- sphoneid telnr=\"(.*)\" fileas=\"(.*)\" -->(.*)<!-- sphoneid --></span></li>isU";
getMatches($strMatch,$strContent);
if ($objMatches !=0)
{
echo '<pre>';print_r ($objMatches);echo '</pre>';
}
else
{
echo "no matches";
}
function getMatches($strMatch,$strContent) {
if(preg_match_all($strMatch,$strContent,$objMatches)){
return $objMatches;
}
return "";
}
$strContent = "<li class="tel"><strong>Tel: </strong><span><!-- sphoneid telnr="+353 (021)4501172" fileas="Abbey Business & Communications" -->(021)4501172<!-- sphoneid --></span></li>";
$strMatch = "<li class=\"tel\"><strong>Tel: </strong><span><!-- sphoneid telnr=\"(.*)\" fileas=\"(.*)\" -->(.*)<!-- sphoneid --></span></li>isU";
getMatches($strMatch,$strContent);
if ($objMatches !=0)
{
echo '<pre>';print_r ($objMatches);echo '</pre>';
}
else
{
echo "no matches";
}