Jump to content

how do i complete this funtion does anybody know??


kevinkhan

Recommended Posts

can anybody tell me how i can complete this function in php?

 

 

 


// $page = html source file

define("LIST_OF_SCHOOLS", "Piarsaigh,Phiarsaigh,Vincents");

$schoolList = explode(',', LIST_OF_SCHOOLS);

function checkForSchool($page, $schoolList) {
   preg_match('|Goes to \\\u003ca href=\\\\"http:\\\/\\\/www.facebook.com\\\/pages\\\/[a-zA-Z-]*\\\/\d*\\\\" data-hovercard=\\\\"\\\/ajax\\\/hovercard\\\/page.php\?[a-zA-Z=0-9]*\\\\">([a-zA-Z\s]*)\\\u003c\\\/a>|', $page, $match);
    if($match && count($match)>0) {
        echo "Match Found";

	// if any of the words in the schoolList array is found in the match from the preg_match function let the 
	// checkForSchool function return true
	// other wise return false

    }

}

}

function checkForSchool($page, $schoolList) {
   preg_match('|Goes to \\\u003ca href=\\\\"http:\\\/\\\/www.facebook.com\\\/pages\\\/[a-zA-Z-]*\\\/\d*\\\\" data-hovercard=\\\\"\\\/ajax\\\/hovercard\\\/page.php\?[a-zA-Z=0-9]*\\\\">([a-zA-Z\s]*)\\\u003c\\\/a>|', $page, $match);
    if($match && count($match)>0) {
        echo "Match Found";
return true;
    }
    return false;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.