la fonction :
function getHrefLinks($content) {
$motif='`<A href="[^>]+">[^<]+</A>`';
preg_match_all($motif,$content,$out);
$motif='`href="[^>]+"`';
$out3 = array();
foreach ($out[0] as $value) {
preg_match_all($motif,$value,$out2);
if (count($out2)>0) {
$thisString = $out2[0][0];
$thisString = str_replace("\"", "", $thisString);
$thisString = str_replace("href=", "", $thisString);
$thisString2 = split (" ", $thisString);
$thisString = $thisString2[0];
if (substr($thisString, 0,strlen("http://"))!="http://") {
$urlParsed = parse_url($_SERVER["PHP_SELF"]);
$path_parts = pathinfo($urlParsed["path"]);
$thisString = "http://".$_SERVER["HTTP_HOST"].$path_parts["dirname"].$thisString;
}
$out3[] = $thisString;
}
}
return $out3;
}
je voudrais eviter de faire une deuxieme fonction qui contiendrait
$motif='`<a href="[^>]+">[^<]+</a>`';
Y a t'il un moyen de concatener ou alors opter pour la solution d une fonction getHrefLinks2 qui extrait les lien dont les balises sont en minuscule?