fork download
  1. <?php
  2. $foo = '+++ Statistics Dump +++ (1499195839)
  3. ++ Incoming Requests ++
  4. 552 QUERY
  5. ++ Incoming Queries ++
  6. 546 A
  7. 1 NS
  8. 5 AAAA
  9. ++ Outgoing Queries ++
  10. [View: default]
  11. 1350 A
  12. 53 NS
  13. 446 AAAA
  14. 544 DS
  15. 35 DNSKEY
  16. [View: _bind]
  17. ++ Name Server Statistics ++
  18. 552 IPv4 requests received
  19. 1 requests with EDNS(0) received
  20. 550 responses sent
  21. 1 responses with EDNS(0) sent
  22. 300 queries resulted in successful answer
  23. 541 queries resulted in non authoritative answer
  24. 6 queries resulted in nxrrset
  25. 9 queries resulted in SERVFAIL
  26. 235 queries resulted in NXDOMAIN
  27. 385 queries caused recursion
  28. 2 duplicate queries received
  29. ++ Zone Maintenance Statistics ++
  30. ++ Resolver Statistics ++
  31. [Common]';
  32.  
  33. if (preg_match_all('#\s+(\d{1,3})\s[^\n]+\n#', $foo, $matches)) {
  34. $retornou = $matches[1];
  35. print_r($retornou); //Exibe todos numeros que pegou
  36. } else {
  37. echo 'Nada encontrado';
  38. }
  39.  
  40.  
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 552
    [1] => 546
    [2] => 1
    [3] => 5
    [4] => 53
    [5] => 446
    [6] => 544
    [7] => 35
    [8] => 552
    [9] => 1
    [10] => 550
    [11] => 1
    [12] => 300
    [13] => 541
    [14] => 6
    [15] => 9
    [16] => 235
    [17] => 385
    [18] => 2
)