Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!$monFichier = fopen('listeproduits/produits.txt', 'r'))
- {
- echo "Impossible d'ouvrir le fichier !<br/>";
- exit();
- }
- else {
- while(!feof($monFichier)){
- $ligne = fgets($monFichier);
- $tligne = explode('|', $ligne);
- $nomProduit = $tligne[1];
- $cheminImage = $tligne[2];
- $prixProduit = $tligne[3] . ' €';
- echo 'Produit: ' . $nomProduit . '<br/>';
- echo 'Prix: ' . $prixProduit . '<br/>';
- echo '<img src="' . $cheminImage . '" height="150" width="150"/><br/>';
- }
- fclose($monFichier);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement