Bonjour,
Voila j'ai besoin de récupérer le MOTD de la chaine suivante.
Elle est stockée dans la variable $buffer que je rempli de la façon suivante :
Mon souci est que lorsque je veux récupérer mes chaines avec la fonction au dessus j'ai juste une page blanche en retour.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 while(!feof($socket)) //Tant que l'on est connecté : { $buffer = fgets($socket, 1024); //On récupère une ligne de données if(strpos($buffer, "372")) //if 372 is contained in the line. { $buffer_parts = explode("372", $buffer); $motd = explode(" ", $buffer_parts[2]); actualiser(); echo $motd; }*/ }
Voici le contenu de $buffer.
Pourtant à priori c'est bien 2chaines après le nombre que je veux récupérer les lignes.:wormnet1.team17.com 001 qsdfd :Welcome to the Internet Relay Network qsdfd :wormnet1.team17.com 002 qsdfd :Your host is wormnet1.team17.com[wormnet1.team17.com/6667], running version 2.8/hybrid-6.3.1 :wormnet1.team17.com 003 qsdfd :This server was created Thu Nov 14 2002 at 20:06:04 GMT :wormnet1.team17.com 004 qsdfd wormnet1.team17.com 2.8/hybrid-6.3.1 oOiwszcrkfydnxb biklmnopstve :wormnet1.team17.com 005 qsdfd WALLCHOPS PREFIX=(ov)@+ CHANTYPES=#& MAXCHANNELS=20 MAXBANS=25 NICKLEN=15 TOPICLEN=120 KICKLEN=90 NETWORK=EFnet CHANMODES=b,k,l,imnpst MODES=4 :are supported by this server :wormnet1.team17.com 251 qsdfd :There are 107 users and 1 invisible on 1 servers :wormnet1.team17.com 252 qsdfd 1 :IRC Operators online :wormnet1.team17.com 254 qsdfd 4 :channels formed :wormnet1.team17.com 255 qsdfd :I have 108 clients and 0 servers :wormnet1.team17.com 265 qsdfd :Current local users: 108 Max: 174 :wormnet1.team17.com 266 qsdfd :Current global users: 108 Max: 174 :wormnet1.team17.com 250 qsdfd :Highest connection count: 174 (174 clients) (2367105 since server was (re)started) :wormnet1.team17.com 375 qsdfd :- wormnet1.team17.com Message of the Day - :wormnet1.team17.com 372 qsdfd :- Welcome to WormNet. :wormnet1.team17.com 372 qsdfd :- :wormnet1.team17.com 372 qsdfd :- Both Wormnet1 and Wormnet2 now run from a single upgraded machine. :wormnet1.team17.com 372 qsdfd :- :wormnet1.team17.com 372 qsdfd :- For more information on the current beta patch & upgrade, visit :wormnet1.team17.com 372 qsdfd :- http://wormsarmageddon.team17.com, or visit the Team17 Forum :wormnet1.team17.com 372 qsdfd :- http://forum.team17.com :wormnet1.team17.com 372 qsdfd :- :wormnet1.team17.com 372 qsdfd :- Anyone using a non-authorized client to connect to this :wormnet1.team17.com 372 qsdfd :- network will have their IP temporarily banned. :wormnet1.team17.com 372 qsdfd :- :wormnet1.team17.com 372 qsdfd :- All traffic may be recorded and/or monitored by Team17 :wormnet1.team17.com 372 qsdfd :- to ensure proper operation. :wormnet1.team17.com 376 qsdfd :End of /MOTD command
Savez vous pourquoi ?
Merci d'avance.
Partager