Connect( SQ_SERVER_ADDR, SQ_SERVER_PORT, SQ_TIMEOUT, SQ_ENGINE ); $Info = $Query->GetInfo( ); $Players = $Query->GetPlayers( ); } catch( Exception $e ) { $Exception = $e; } $Query->Disconnect( ); $Timer = Number_Format( MicroTime( true ) - $Timer, 4, '.', '' ); $InfoGT = $Info['GameTags']; print_r($Info); echo "

RESULTS

"; $sname = $Info['HostName'] ; $Players = $Info['Players'] ; $MaxPlayers = $Info['MaxPlayers'] ; $Secure = $Info['Secure'] ; $Map = $Info['Map'] ; $Os = $Info['Os'] ; $Version = $Info['Version'] ; $GamePort = $Info['GamePort'] ; echo "Hostname: " .$sname . "
"; echo "Players: " .$Players . "
"; echo "MaxPlayers: " .$MaxPlayers . "
"; echo "Secure: " .$Secure . "
"; echo "Map: " .$Map . "
"; echo "Os: " .$Os . "
"; echo "Version: " .$Version . "
"; echo "Port: " .$GamePort . "

"; echo "

Payes ta regex

"; echo "
".$InfoGT."
"; echo "
"; $result = explode(",", $InfoGT); $re = '/[^,]...(Hive)/'; print_r($result); echo "
"; $rt = preg_grep($re, array($InfoGT)); print_r($rt); echo "

"; $regtimsev = "/(battleye)/"; $result = preg_grep($regtimsev, explode(",", $InfoGT)); //print_r($result); echo $result[0]; echo "

"; $result = preg_grep($re,explode(",", $InfoGT)); //print_r( preg_grep($re, array($InfoGT))); echo $result[2]; echo "

"; $regtimsev = "/[0-9]{1,2}[:][0-9]{1,2}/"; $result = preg_grep($regtimsev, explode(",", $InfoGT)); //print_r($result); echo $result[8]; echo "

"; $regtimeacc = "/([0-9][.][0-9]{1})/"; $result = preg_grep($regtimeacc, explode(",", $InfoGT)); //print_r($result); echo $result[5]; echo "

"; $regtimeacn = "/([0-9][.][0-9]{1})/"; $result = preg_grep($regtimeacn, explode(",", $InfoGT)); //print_r($result); echo $result[6]; echo "

"; echo "

Payes ton explode

"; $retest = explode(",", $InfoGT); echo $retest[0] . "|".$retest[2]. "|". $retest[3]. "|". $retest[4]. "|". $retest[8]. "|". $retest[5]. "|". $retest[6]; /* $regtimsev = "[0-9]{1,2}[:][0-9]{1,2}"; $reghive = "[^,]...(Hive)"; $regtimeacc = "[^,etm][0-9][.][0-9]{1}"; //$regtimeacn = "[^,entm][0-9][.][0-9]{1}"; $regtimeacn = "([0-9][.][0-9]{1})"; //echo preg_grep('/[0-9]{1,2}[:][0-9]{1,2}/', explode("\n", $InfoGT)); echo preg_grep('/$regex/', $InfoGT); $fl_array = preg_grep("/[^,entm][0-9][.][0-9]{1}/", $InfoGT); echo $fl_array; */ echo "
"; $re = '/[0-9]{1,2}[:][0-9]{1,2}/m'; $str = 'battleye,external,privHive,shard,lqs0,etm2.000000,entm5.500000,mod,23:17'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result //var_dump($matches); echo '
'; print_r($matches); echo '
'; echo "
"; $encode = json_encode($matches); echo $encode; echo "
"; //echo $matches[0]; $output = implode(",", array($str)); echo $output; echo "
"; $output1 = implode(",", array($matches)); echo $output1; echo "
"; ?>