I'm doing a script for get all the links from a website but I want to get only the links with a specific word. I have the following script and now I can get all the links and I don't know how to create a regx for search the word I want:
$url = file_get_contents("http://www.example.es");
preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $url, $todosenlaces);