PayPal的
PHP IPN侦听器的示例代码在顶部有这个注释/代码:
@H_404_6@
- // reading posted data from directly from $_POST causes serialization
- // issues with array data in POST
- // reading raw POST data from input stream instead.
- $raw_post_data = file_get_contents('PHP://input');
- $raw_post_array = explode('&',$raw_post_data);
- $myPost = array();
- foreach ($raw_post_array as $keyval) {
- $keyval = explode ('=',$keyval);
- if (count($keyval) == 2)
- $myPost[$keyval[0]] = urldecode($keyval[1]);
- }
有人可以解释这个评论引用的序列化问题吗?虽然我可以这样做,我会觉得更加舒服,知道为什么应该这样做.