I have 2 xPath requests :
$medias = $xpath->query("//strong//a[contains(@class, 'no')]");
$links = $xpath->query("//strong//a[contains(@class, 'no')]/@href");
My goal is to have only one array that contains something like this :
0 => array:1 [▼
"title" => "A besúgó"
"link" => "xyz"
]
I tried this
$i=0;
foreach($medias as $media)
{
$tab[]['titre'] = $media->textContent;
$i++;
}
$i=0;
foreach($medias as $media)
{
$tab[]['lien'] = $media->textContent;
$i++;
}
dd($tab);
But it's ugly and it does not work. Can you help ?