salut j'essaye d'afficher des prooduit d'un autre site sur le mien
mais j'ais une erreur
Array to string conversion
voici mon script :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
 
$recherche=htmlspecialchars($_POST['titrecomparer']);
 
if (isset($recherche)) {
//sur jumia 
$url = 'https://www.jumia.ci/catalog/?q='.$recherche.'&sort=Price%3A%20Low%20to%20High&dir=asc';
$page = file_get_contents($url); 
preg_match_all("#<a class=\"link\" href=\"https://www.jumia.ci/+.html\"> + </a>#iu", $page, $infos);
 
echo '<pre>';
print_r($infos);
echo '</pre>';
 
//sur deal jumia
$url = 'https://deals.jumia.ci/catalog?search-keyword='.$recherche.'&xhr=1y4qi&sortBy=price&sortOrder=asc';
$page = file_get_contents($url); 
preg_match_all("#<article class=\"post-holder product-click\" data-event=\"+\" data-position=\"1\" data-state=\"approved\">+</article>
#iu", $page, $infos);
 
echo '<pre>'.$infos['0'].'</pre>';
}
else{
   header("location:../model/osiris.php");
}
?>