Created
February 29, 2016 13:06
-
-
Save rococodogs/ad5e2019da8a7a177eaf to your computer and use it in GitHub Desktop.
loop to handle nd-json (mostly b/c I forget how to handle stdin in 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
| <?php | |
| while ( $raw_line = fgets(STDIN) ) { | |
| $line = trim($raw_line); | |
| $parsed = json_decode($line); | |
| // do something with yr object | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment