Last active
September 14, 2015 11:01
-
-
Save bologer/88e528816fee12bf35a3 to your computer and use it in GitHub Desktop.
preg_match php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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