fork download
  1. <?php
  2.  
  3. $content = "Server (1.7.2) playercount: 400/500";
  4. preg_match('/^\w+\s\((\d\.\d\.\d)\)\s\w+:\s(\d+\/\d+)$/', $content, $result);
  5. print_r($result);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Server (1.7.2) playercount: 400/500
    [1] => 1.7.2
    [2] => 400/500
)