 <p>Iterate through all links that can be a potential match, then check whether their <code>href</code> matches your criteria. You can do this check by using <a href="http://php.net/manual/en/book.strings.php" rel="nofollow">basic string functions</a> or <a href="http://php.net/manual/en/book.pcre.php" rel="nofollow">regular expressions</a> if the criteria are too advanced for basic matches.</p>