doumanshan6314 2016-07-01 00:52
浏览 99

通过cURL发送收到的原始JSON

I just want a little help. So this is the scenario:

I have a php script that received a JSON and get it by file_get_contents function. The json is send by API more likely like Glabs. So for example I'll text the given shortcode for the API and it will send in json format and I'll be receiving it via PHP.

My question is, how can i send the original json format that i've received via cURL? and receive it again by file_get_contents?is it possible?

Here is my sample script:

$json = file_get_contents('php://input');
$json = stripslashes($json);
$values=json_decode($json,true);

$Msg=$values["inboundSMSMessageList"]["inboundSMSMessage"][0]["message"];
$dateTime=$values["inboundSMSMessageList"]["inboundSMSMessage"][0]["dateTime"];
$MPN=str_replace("tel:","",$values["inboundSMSMessageList"]["inboundSMSMessage"][0]["senderAddress"]);

That is my script for receiving a message sent from a mobile phone to a shortcode then received by my script. Thanks for who will help me

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致
    • ¥15 高德地图点聚合中Marker的位置无法实时更新
    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题