Skip to content

Instantly share code, notes, and snippets.

@bologer
Last active September 14, 2015 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bologer/88e528816fee12bf35a3 to your computer and use it in GitHub Desktop.
Save bologer/88e528816fee12bf35a3 to your computer and use it in GitHub Desktop.
preg_match php
// get: Steam_id
if( preg_match('^STEAM_[0-1]:[0-1]:(\d+)^', $values[0][$k], $m) ) {
$players[$key]['SteamId'] = $m[0];
}
if( preg_match('/\\s/([0-9]{1,4})/\\s/', $value[0][$k], $m) ) {
$players[$key]['Frags'] = $m[0];
}
// get: Time
if( preg_match('^[0-9][0-9]:[0-9][0-9]^', $values[0][$k], $m) ) {
$players[$key]['TimeF'] = $m[0];
}
// IP:port
if( preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\:[0-9]{1,5}/', $type) ) {
}
// get: User IP
if( preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $values[0][$k], $m) ) {
$players[$key]['Ip'] = $m[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment