Ciao... da questa funzione controllo se un det. link esiste in una pagina web
controlla se in una det. pagina esiste il link http://www.sito.ext/
però se nel sito cerca il link http://www.sito.ext (senza /) non lo trova...
trova solo il link "preciso" http://www.sito.ext/
cosa c'è di errato?
grazie
Codice PHP:
if (preg_match_all('/<a\s[^>]*href=([\"\']??)([^" >]*?)\\1([^>]*)>/siU', $html, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
if ($match[2] == $settings['site_url'] || $match[2] == $settings['site_url'].'/') {
$found = 1;
break;
}
}
}