Jump to content
php.lv forumi

sscanf korekts format


_siikais_

Recommended Posts

taatad ir rindinja kuru vajag nolasiit ar sscanf

16:37:10 [user][char]AI[107,Manta ar atstarpem,0,0,0,1]serial:[31574236] dur:[65] Ex:[0,0,1,0,0,0,0] Set[0] 380:[0] HO:[0,0]

 

bet ar shaadu format vinjsh nelasa kaa gribeetos

list($tag1,$tag2,$tag3,$tag4,$tag5,$tag6,$tag7,$tag8,$tag9,$tag10)=sscanf($rinda, "%s [%s][%s]AI[%s]serial:[%s] dur:[%s] Ex:[%s] Set[%s] 380:[%s] HO:[%s]");

 

varbuut kaads var ieposteet pareizu format lai visas veertiibas kas ir [] iekavaas panjem kaa mainiigo

 

paldies jau ieprieksh ;)

Link to comment
Share on other sites

$s = '16:37:10 [user][char]AI[107,Manta ar atstarpem,0,0,0,1]serial:[31574236] dur:[65] Ex:[0,0,1,0,0,0,0] Set[0] 380:[0] HO:[0,0]';
list($tag1,$tag2,$tag3,$tag4,$tag5,$tag6,$tag7,$tag8,$tag9,$tag10)=sscanf($s, '%s [%[^]]][%[^]]]AI[%[^]]]serial:[%[^]]] dur:[%[^]]] Ex:[%[^]]] Set[%[^]]] 380:[%[^]]] HO:[%[^]]]');

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...