php - 将 POST 文本输出转换为 JSON
问题描述
我正在将 POST 转换为 JSON,然后保存到表中。不知何故,我的代码和查询不起作用,我还将 POST 输出文本发送到电子邮件中作为备份。我必须将丢失的 JSON 条目保存到表中。我有 JSON 格式,我可以手动将 POST 转换为 JSON,但这将非常耗时,而且我有很多数据需要保存。无论如何我可以将 POST 输出文本转换为 JSON 吗?
下面是我必须转换为 JSON 的 POST 输出文本。
Array ( [mc_gross] => 2.00 [protection_eligibility] => Ineligible [address_status] => confirmed [payer_id] => W92W4QGG4DPSE [tax] => 0.00 [address_street] => Street Park [payment_date] => 08:49:32 Oct 01, 2020 PDT [payment_status] => Pending [charset] => windows-1252 [address_zip] => 123456 [first_name] => John [address_country_code] => US [address_name] => Address name [notify_version] => 3.9 [custom] => 14673|2628|0|0 [payer_status] => verified [address_country] => US [address_city] => City [quantity] => 1 [verify_sign] => AYeK0nPD6ny3nwQhXIe-HRLjFsBxAbVcuekfRoqaw421iA6T6-9HuwOZ [payer_email] => ea9ym2967401@exampledomain.com [txn_id] => 7NK31954DJ9775812 [payment_type] => instant [last_name] => Doe [address_state] => State [receiver_email] => info@domain.com [shipping_discount] => 0.00 [insurance_amount] => 0.00 [pending_reason] => unilateral [txn_type] => web_accept [item_name] => US Open 2020 [discount] => 0.00 [mc_currency] => USD [item_number] => 23344 [residence_country] => US [test_ipn] => 1 [shipping_method] => Default [transaction_subject] => [payment_gross] => 2.00 [ipn_track_id] => 53d2891cbb8c1 )
解决方案
推荐阅读
- spring-cloud-feign - openfeign 和 feign 的区别
- python - Pandas:如何使用其他数据框的列替换数据框中的值
- arduino - 如何在同一代码中使用基于 Web 的代码和真实按钮?
- vb.net - DataGridView 到 Word 列标题未显示
- bixby - bixby 如何读取不显示的文本?
- java - 将字符串转换为 ParseObject
- spring - Spring Boot:静态内容正确提供 CSS 但不提供 JS
- twig - 在 Craft 3 中使用 {% requireLogin %} 时如何设置自定义重定向 URL?
- php - 为什么我在尝试发送电子邮件以使用 phpmailer 激活新用户帐户时收到此错误
- python-3.x - 仅当不存在某些异常时,如何拆分字符串?