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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥100 求数学坐标画圆以及直线的算法
    • ¥35 平滑拟合曲线该如何生成
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败
    • ¥15 eclipse运行项目时遇到的问题
    • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
    • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
    • ¥15 自己瞎改改,结果现在又运行不了了
    • ¥15 链式存储应该如何解决