Web site For example: Http://123456.com/Ashx/actForm.ashx?action=addorder&gameid=65&num=10&realname= small Dream & useremail=xiaomeng@qq.com&searchpass=123654
The display after submission is {"Types": "OK", "MSG": "17961_14102404200616788"}
I want to use PHP directly call out _ after the number 14102404200616788
Do not know how to achieve, I novice, do not quite understand Baidu a half-day!
Reply to discussion (solution)
$s = ' {' types ': ' OK ', ' msg ': ' 17961_14102404200616788 '} ';
Echo Explode (' _ ', Json_decode ($s)->msg) [1];
$s = ' {' types ': ' OK ', ' msg ': ' 17961_14102404200616788 '} ';
Echo Explode (' _ ', Json_decode ($s)->msg) [1];
Concise, but not directly in the back add [1]
$result = file_get_contents (' http://123456.com/ashx/actform.ashx?action=addorder&gameid=65&num=10& Realname= small Dream &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"} but every time this generation is different WOW!!!
For example
{"Types": "OK", "MSG": "17961_14102404200616788"}
{"Types": "OK", "MSG": "17962_14102453453453453"}
{"Types": "OK", "MSG": "17963_14102534534534535"}
{"Types": "OK", "MSG": "17964_14102534534534534"}
Open it once and he generates it once WOW!
Every time there is a different problem, the treatment method is the same.
$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). '
';} function GetData ($str) { $data = Json_decode ($str, true); List ($id, $timestamp) = Explode (' _ ', $data [' msg ']); return $timestamp;}
14102404200616788
14102453453453453
14102534534534535
14102534534534534
Now call out how to put 14102404200616788 Json call to JS over there, for example, someone else's site display
Online pageJumping page ...