Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. echo "<head><meta charset=\"UTF-8\"><title>Site Web Test Goldorak85</title><link rel=\"icon\" href=\"img/ico.png\"></head>";
  2.  
  3. define ('DBR', "<br><br>");
  4.  
  5. // Je fait un test de tableau.
  6. $a = ["Personnes","Carot", "Patate", "Pomme", "Fraise", "cerise", "Banane", "Farine", "Oeuf"];
  7. $b = ["2", "50ml", "10", "2", "40", "20", "3", "10Kg", "5"];
  8. $c = ["20", "500ml", "100", "20", "400", "200", "30", "100Kg", "50"];
  9. $d = ["200", "5000ml", "1000", "200", "4000", "2000", "300", "1000Kg", "500"];
  10. $e = ["2000", "50000ml", "10000", "2000", "40000", "20000", "3000", "10000Kg", "5000"];
  11. $r = [$a,$b,$c,$d,$e];
  12.  
  13. $tmp = "";
  14. $tmp2 = "";
  15.  
  16. echo "1Er explemple de tableau pas tres jolie";
  17. echo DBR;
  18.  
  19. foreach ($r as $tmp){
  20. foreach ($tmp as $tmp2){
  21. echo $tmp2." ";
  22. }
  23. echo "<br>";
  24. }
  25.  
  26. $check = false;
  27.  
  28.  
  29. echo DBR;
  30. echo "Deuxieme tableau plus propre.";
  31. echo DBR;
  32.  
  33. echo "<html><table>";
  34.  
  35. foreach ($r as $tmp){
  36. if(!$check){
  37. echo "<thead><tr>";
  38. foreach ($tmp as $tmp2){
  39. echo "<td>$tmp2</td>";
  40. }
  41. echo "</tr></thead>";
  42. }else{
  43. foreach ($tmp as $tmp2){
  44. echo "<tbody><tr>";
  45. foreach ($tmp as $tmp2){
  46. echo "<td>$tmp2</td>";
  47. }
  48. echo "</tr></tbody>";
  49. }
  50. }
  51.  
  52.  
  53. }
  54.  
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement