php同步刷新,php – file_get_contents同步或异步

绝对不是同步与异步的问题.但是调试是非常不可能的.尝试这样的事情.死亡陈述很难看,但说明了你可能希望合并的验证……

$data = file_get_contents("http://example.com/aaa.php?user=tester&akey=abcdef1234");

if (empty($data)) die('Failed to fetch data');

$dec = json_decode($data, true);

if (is_null($dec) || $dec === false) die('Failed to decode data');

$tokenid = isset($dec['message']['result']['tokenid']) ? $dec['message']['result']['tokenid'] : null;

if (is_null($tokenid) die('Token ID is not set');

//...

$data=file_get_contents("http://example.com/bbb.php?user=tester&token=".$tokenid);

猜测可能是您的令牌有时包含需要转义的“特殊”字符.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值