Nouveau WRInaute
bonjour,
Google référence t-il les variables d'un tableau array ? :?:
Google référence t-il les variables d'un tableau array ? :?:
$produit = array(1 => 'pain',
2 => 'lait',
3 => 'chocolat');
$recherche = 'pain lait cacahuète chocolat lait';
$motcle = array_unique(explode(" ", $recherche));
foreach($motcle as $mot)
{
if(array_search($mot, $produit))
{
echo sprintf('Nous avons ce produit : %s <br />', $mot);
}
else
{
echo sprintf('Pas de produit : %s <br />', $mot);
}
}