Skip to content

Instantly share code, notes, and snippets.

@arturom
Created October 12, 2015 16:25
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 arturom/b6ad2a7990ef41d882d8 to your computer and use it in GitHub Desktop.
Save arturom/b6ad2a7990ef41d882d8 to your computer and use it in GitHub Desktop.
<?php
stream_set_blocking(STDIN, 1);
$pattern = '(?<=Request Body \[).+?(?=\] {"file")';
while(($line = fgets(STDIN)) !== false) {
if(preg_match($pattern, $line) === 1) {
echo json_decode($matches[0]), PHP_EOL;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment