par
bagou450 » 25 oct. 2021, 14:40
J'ai reussi au final avec ceci
Code : Tout sélectionner
$url = 'Mon URL';
$pattern = '#(?:src|href|path|xmlns(?::xsl)?)\s*=\s*(?:"|\')\s*(.+)?\s*(?:"|\')#Ui';
$subject = file_get_contents($url);
preg_match_all($pattern, $subject, $matches, PREG_PATTERN_ORDER);
foreach($matches[1] as $match)
{
if (str_starts_with($match, './')) {
$hrefresult= str_replace("./", "", $match);
$hrefresult2= strtok($artifactslink, '-');
$tablo_liens[] = array(
"hrefresult"=>$hrefresult,
"another things"=>$hrefresult2
);
}
}
echo $tablo_liens;
Merci

J'ai reussi au final avec ceci
[code] $url = 'Mon URL';
$pattern = '#(?:src|href|path|xmlns(?::xsl)?)\s*=\s*(?:"|\')\s*(.+)?\s*(?:"|\')#Ui';
$subject = file_get_contents($url);
preg_match_all($pattern, $subject, $matches, PREG_PATTERN_ORDER);
foreach($matches[1] as $match)
{
if (str_starts_with($match, './')) {
$hrefresult= str_replace("./", "", $match);
$hrefresult2= strtok($artifactslink, '-');
$tablo_liens[] = array(
"hrefresult"=>$hrefresult,
"another things"=>$hrefresult2
);
}
}
echo $tablo_liens;[/code]
Merci ;)