不能传递数组中的PHP发布 [英] Cant pass array to post in PHP

查看:116
本文介绍了不能传递数组中的PHP发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的数组:

Array
(
    [lead_id] => 107
    [source_type] => 1
    [source_id] => 1
    [lead_content] => {"1":"11","2":"11"}
    [user_ip] => ::1
    [user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
    [user_referer] => 
    [old_user_lead_id] => 5
    [user_id] => 1
    [lead_status_id] => 1
    [lead_management_comment] => 
    [time] => 2016-02-17 20:11:24
    [utm_source] => 
    [utm_medium] => 
    [utm_term] => 
    [utm_content] => 
    [utm_campaign] => 
    [lead_status_name] => Received
)

我尝试这个code送他:

I try to send him with this code:

 $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    if ($post) {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_REFERER, get_site_url());
    $result = curl_exec($ch);
    curl_close($ch);

在另一边,我有code,只是打​​印$ _ POST。但是,这code未打印此数组中的任何(与其他数组它做工精细)。
为什么数组不通过?难道是因为那里是我的阵列任何非法字符?

In the other side i have code that just print the $_POST. But this code is not print anything with this array (with other array it's work fine). Why the array does not pass? Could it be because of there is any illegal characters in my array?

感谢:)

推荐答案

问题解决了。这不是数组。
的问题是,接收到的数据的文件中。
他有一个保护,防止显示字符太多。这是非常愚蠢的我。

problem solved. It was not the array. The problem was in the file that receives the data. He had a protection against displaying too many characters. It was very stupid of me.

感谢大家的帮助:)

这篇关于不能传递数组中的PHP发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆