Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo "<head><meta charset=\"UTF-8\"><title>Site Web Test Goldorak85</title><link rel=\"icon\" href=\"img/ico.png\"></head>";
- define ('DBR', "<br><br>");
- // Je fait un test de tableau.
- $a = ["Personnes","Carot", "Patate", "Pomme", "Fraise", "cerise", "Banane", "Farine", "Oeuf"];
- $b = ["2", "50ml", "10", "2", "40", "20", "3", "10Kg", "5"];
- $c = ["20", "500ml", "100", "20", "400", "200", "30", "100Kg", "50"];
- $d = ["200", "5000ml", "1000", "200", "4000", "2000", "300", "1000Kg", "500"];
- $e = ["2000", "50000ml", "10000", "2000", "40000", "20000", "3000", "10000Kg", "5000"];
- $r = [$a,$b,$c,$d,$e];
- $tmp = "";
- $tmp2 = "";
- echo "1Er explemple de tableau pas tres jolie";
- echo DBR;
- foreach ($r as $tmp){
- foreach ($tmp as $tmp2){
- echo $tmp2." ";
- }
- echo "<br>";
- }
- $check = false;
- echo DBR;
- echo "Deuxieme tableau plus propre.";
- echo DBR;
- echo "<html><table>";
- foreach ($r as $tmp){
- if(!$check){
- echo "<thead><tr>";
- foreach ($tmp as $tmp2){
- echo "<td>$tmp2</td>";
- }
- echo "</tr></thead>";
- }else{
- foreach ($tmp as $tmp2){
- echo "<tbody><tr>";
- foreach ($tmp as $tmp2){
- echo "<td>$tmp2</td>";
- }
- echo "</tr></tbody>";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement