URL 例: http://123456.com/Ashx/actForm.ashx?action=addorder&gameid=65&num=10&realname=小梦&UserEmail=xiaomeng@qq.com&SearchPass=123654
送信後、表示は {"types" になります。 :"OK ","msg":"17961_14102404200616788"}
PHP を使用して次の番号 _ 14102404200616788 を直接呼び出したいです
初心者なので、Baidu のことをよく理解していません。長い間!
$s = '{"types":"OK","msg":"17961_14102404200616788"}'
echoexplode('_', json_decode($s)-; >msg)[1];
$s = '{"types":"OK","msg":"17961_14102404200616788"}'
echoexplode('_', json_decode($s)-> msg)[1];
//$result = file_get_contents('http://123456.com/Ashx/actForm.ashx?action=addorder&gameid=65&num=10&realname=小梦&UserEmail=xiaomeng@qq.com&SearchPass=123654');$result = '{"types":"OK","msg":"17961_14102404200616788"}';$json = json_decode($result,true);$id = explode('_',$json['msg']);echo $id[1];
{"types":"OK","msg":"17961_14102404200616788"} しかし、この世代はすべて異なります時間 うわー! ! !
たとえば、
{"types":"OK","msg":"17961_14102404200616788"}
{"types":"OK","msg":"17962_14102453453453453"}
{"types":" OK", " msg":"17963_14102534534534535"}
{"types":"OK","msg":"17964_14102534534534534"}
一度開くと一度生成されます。
れーい
14102404200616788
14102453453453453
14102534534534535
14102534534534534
$result = array( '{"types":"OK","msg":"17961_14102404200616788"}', '{"types":"OK","msg":"17962_14102453453453453"}', '{"types":"OK","msg":"17963_14102534534534535"}', '{"types":"OK","msg":"17964_14102534534534534"}' );foreach($result as $v){ echo getdata($v).'<br>';}function getdata($str){ $data = json_decode($str, true); list($id, $timestamp) = explode('_', $data['msg']); return $timestamp;}