Skip to content

Instantly share code, notes, and snippets.

@rmccullagh
Created April 28, 2015 01:27
Show Gist options
  • Save rmccullagh/a874cd753782ae5cc798 to your computer and use it in GitHub Desktop.
Save rmccullagh/a874cd753782ae5cc798 to your computer and use it in GitHub Desktop.
<?php
$str = "Sending: 6011 1234 4321 1234:12/2016:543.21:John Doe
Received: Mon Apr 27 18:07:22 CDT 2015: Discover: 6011 1234 4321 1234 is valid: authorization code: 472080 for $543.21";
$a = preg_split("/\n/", $str);
array_shift($a);
$c = preg_match_all('/authorization\scode:\s[0-9]+/', $a[0], $matches);
$d = preg_split('/\n/', $matches[0][0]);
$e = explode(" ", $d[0]);
var_dump($e[2]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment