Nouveau WRInaute
Bonjour, pouvez vous m'aidé car je suis débutant
je peux lire mon fichier mais je souhaiterais le faire dans un tableau en récupérant certaines lignes du fichier.Merci
Sa donne sa:
GOArray ( [0] => LFFF_CTR [1] => ATC [2] => Aventureclub AIRLINES [3] => ATC [4] => 128.10 [5] => 48.713056 [6] => 2.418888 [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => -AventureClub- [15] => 0.0.4.H [16] => 11 [17] => [18] => 6 [19] => 700 [20] => [21] => [22] => [23] => [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => No Atis * 212.227.107.53 Port 8767/LFFF_CTR [36] => [37] => 20140713115211 [38] => DafRadar [39] => 0.0.4.H [40] => 11 [41] => 10 [42] => [43] => [44] => [45] => [46] => ) Array ( [0] => ACF13 [1] => ACF13 [2] => Jean-louis [3] => PILOT [4] => 122.800 [5] => 29.302073 [6] => -10.647657 [7] => 36796 [8] => 463 [9] => T/E170/F [10] => 350 [11] => GMML [12] => 370 [13] => GMMN [14] => -AventureClub- [15] => 0.0.4.X [16] => 10 [17] => 2014 [18] => [19] => [20] => [21] => I [22] => 0000 [23] => 0000 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => GMME [29] => [30] => SOLNA UA600 ADM UG850 MAK UR722 CSD [31] => [32] => [33] => [34] => [35] => [36] => [37] => 20140713075043[38] => Daf*FSX [39] => 0.0.4.X [40] => 1 [41] => 10 [42] => [43] => [44] => 1 [45] => 52 [46] => 0 ) Array ( [0] => ACF01[1] => ACF01[2] => Denis BOUS [3] => PILOT [4] => 122.80 [5] => 42.697582 [6] => 13.558798 [7] => 37259 [8] => 483 [9] => T/B787/F [10] => 470 [11] => LFRS [12] => 370 [13] => LGAV [14] => -AventureClub- [15] => 0.0.4.X [16] => 12 [17] => 1200 [18] => [19] => [20] => [21] => I [22] => 0000 [23] => 0000 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => NONE [29] => [30] => LUGEN UM616 BEBIX UP860 MEDAM UM730 KUMIN UM730 KODOK UM730 FRZ UM872 VALEN UZ904 PREKI UQ920 PES UM872 DIVKU UP92 BRD UL995 KRK UL53 PIKAD [31] => [32] => [33] => [34] => [35] => [36] => [37] => 20140713095031 [38] => Daf*XP10 [39] => 0.0.4.X [40] => 12 [41] => 10 [42] => [43] => [44] => 198 [45] => 120 [46] => 0 ) Array ( [0] => !SERVERS )...
En couleurs,c'est ce que je veux récupérer "vert colonne: Online controleurs champs:ATC,Name,frequency et en bleu pour une colonne: Online Pilotes champs:Callsign,Name,FS . la liste change en fonction des membres connecter sur le server [3] => ATC et[4] => PILOT clé primaire pour mes colonnes
Merci de votre aide
je peux lire mon fichier mais je souhaiterais le faire dans un tableau en récupérant certaines lignes du fichier.Merci
Code:
<?php
$bdd = NEW PDO('mysql:host=localhost;dbname=server_statut','root','', array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$reponse = mysqli_init("SELECT * FROM server_statut");
$url="http://aventureclub-airlines.fr/whazzup/whazzup.txt";
$tab = file($url);
$start = FALSE;
foreach ($tab as $line) {
$line = trim($line);
if ($line == '') { break; }
if ($start) {
print_r(explode(':',$line));
}
if ($line == '!CLIENTS') {
$start = TRUE;
echo 'GO';
}
elseif ($line == '!SERVERS') {
$start = FALSE;
}
}
?>
Sa donne sa:
GOArray ( [0] => LFFF_CTR [1] => ATC [2] => Aventureclub AIRLINES [3] => ATC [4] => 128.10 [5] => 48.713056 [6] => 2.418888 [7] => [8] => [9] => [10] => [11] => [12] => [13] => [14] => -AventureClub- [15] => 0.0.4.H [16] => 11 [17] => [18] => 6 [19] => 700 [20] => [21] => [22] => [23] => [24] => [25] => [26] => [27] => [28] => [29] => [30] => [31] => [32] => [33] => [34] => [35] => No Atis * 212.227.107.53 Port 8767/LFFF_CTR [36] => [37] => 20140713115211 [38] => DafRadar [39] => 0.0.4.H [40] => 11 [41] => 10 [42] => [43] => [44] => [45] => [46] => ) Array ( [0] => ACF13 [1] => ACF13 [2] => Jean-louis [3] => PILOT [4] => 122.800 [5] => 29.302073 [6] => -10.647657 [7] => 36796 [8] => 463 [9] => T/E170/F [10] => 350 [11] => GMML [12] => 370 [13] => GMMN [14] => -AventureClub- [15] => 0.0.4.X [16] => 10 [17] => 2014 [18] => [19] => [20] => [21] => I [22] => 0000 [23] => 0000 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => GMME [29] => [30] => SOLNA UA600 ADM UG850 MAK UR722 CSD [31] => [32] => [33] => [34] => [35] => [36] => [37] => 20140713075043[38] => Daf*FSX [39] => 0.0.4.X [40] => 1 [41] => 10 [42] => [43] => [44] => 1 [45] => 52 [46] => 0 ) Array ( [0] => ACF01[1] => ACF01[2] => Denis BOUS [3] => PILOT [4] => 122.80 [5] => 42.697582 [6] => 13.558798 [7] => 37259 [8] => 483 [9] => T/B787/F [10] => 470 [11] => LFRS [12] => 370 [13] => LGAV [14] => -AventureClub- [15] => 0.0.4.X [16] => 12 [17] => 1200 [18] => [19] => [20] => [21] => I [22] => 0000 [23] => 0000 [24] => 0 [25] => 0 [26] => 0 [27] => 0 [28] => NONE [29] => [30] => LUGEN UM616 BEBIX UP860 MEDAM UM730 KUMIN UM730 KODOK UM730 FRZ UM872 VALEN UZ904 PREKI UQ920 PES UM872 DIVKU UP92 BRD UL995 KRK UL53 PIKAD [31] => [32] => [33] => [34] => [35] => [36] => [37] => 20140713095031 [38] => Daf*XP10 [39] => 0.0.4.X [40] => 12 [41] => 10 [42] => [43] => [44] => 198 [45] => 120 [46] => 0 ) Array ( [0] => !SERVERS )...
En couleurs,c'est ce que je veux récupérer "vert colonne: Online controleurs champs:ATC,Name,frequency et en bleu pour une colonne: Online Pilotes champs:Callsign,Name,FS . la liste change en fonction des membres connecter sur le server [3] => ATC et[4] => PILOT clé primaire pour mes colonnes
Merci de votre aide