phpでpost json ファイルかす

php po.php http://yahoo.cojp { test4 :¥[{ test5 : ccc test6 : ddd }¥]} o1.log

function http_post ($url $data $outputfile)
<?php

// URLを指定
&#36;url = &#36;argv[1];
&#36;data = &#36;argv[2];
&#36;outputfile = &#36;argv[3];

// POST用関数
function http_post(&#36;url &#36;data &#36;outputfile)
&#123;
&#36;data_url = http_build_query (&#36;data);
&#36;data_len = strlen (&#36;data_url);
return array (
content => file_get_contents (
&#36;url
false
stream_context_create (
array ( http =>
array (
method => POST
header => Content-Type: application/x-www-form-urlencoded&yen;r&yen;nContent-Length: &#36;data_len&yen;r&yen;n
content =>&#36;data_url)
)
)
)
headers => &#36;http_response_header
);
&#125;

// 送信
&#36;result = http_post(&#36;url &#36;data &#36;outputfile);

&#36;fp = @fopen(&#36;outputfile w );
ob_start();
print_r(&#36;result);
&#36;buffer = ob_get_contents();
ob_end_clean();
fputs(&#36;fp &#36;buffer);
fclose(&#36;fp);
?>