Skip to content

Instantly share code, notes, and snippets.

@nida-001
Created July 4, 2017 11:25
Show Gist options
  • Save nida-001/360827c4f7eaaf9120bbc7c07acc52a9 to your computer and use it in GitHub Desktop.
Save nida-001/360827c4f7eaaf9120bbc7c07acc52a9 to your computer and use it in GitHub Desktop.
標準入力のJSONをDynamoDB JSONにMarshallする
<?php
require 'vendor/autoload.php';
use Aws\DynamoDb\Marshaler;
$json = "";
while ( ! feof(STDIN) ) {
$line = trim(fgets(STDIN));
$json .= $line;
}
$marshaler = new Marshaler();
$arr = $marshaler->marshalJson($json);
echo json_encode($arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment