PHP提取Json当中的几个数据!50分求解答 高手来帮忙下! $s = '{"types":"OK","msg":"17961_14102404200616788"}';echo explode('_', json_decode($s)->msg)[1]; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //$result = file_get_contents('http://123456.com/Ashx/actForm.ashx?action=addorder&gameid=65&num=10&realname=小梦&[email protected]&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"}打开一次 他生成一次哇! 每次不一样有什么问题呢,处理方法都一样。 $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;}14102404200616788141024534534534531410253453453453514102534534534534 现在调用出来了 接下来 要怎么把 14102404200616788 Json 调用到 JS那边去 例如别人网站 显示 <!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>在线页面</title></head><body><div>正在跳转页面... ...</div></body></html><script>location.href='http://123456789.com/dopay/alipaydirect/do.aspx?orderid=14102422381915240'</script> 请教如何学习PHP windows下网络设置 实在不知道哪有问题了.哎. 求PHP手册上各个类库,数据库功能的介绍 php创建sql server 2000全局临时表失败 新手求助:<?php echo $_POST["opt"]=="+" ? "selected" : "" ?> 关于让php以exe方式运行问题???高分请教 各位请教关于一个javascript的问题,多谢:) 操作access,需要什么dll,怎么做? 能不能控制 <input type=text> 框中的字符 居中 ,居右? 在百度站长平台上面提示需要优化首字节时间,请问用什么方法进行优化? 求教这个的图片怎么去掉
$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":"17962_14102453453453453"}
{"types":"OK","msg":"17963_14102534534534535"}
{"types":"OK","msg":"17964_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;
}
14102404200616788
14102453453453453
14102534534534535
14102534534534534
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>在线页面</title>
</head><body><div>正在跳转页面... ...</div>
</body>
</html>
<script>location.href='http://123456789.com/dopay/alipaydirect/do.aspx?orderid=14102422381915240'</script>