dongwei1954 2014-02-10 15:43
浏览 10
已采纳

从数组中获取值

How i can take this values from the sencond key [post_data]

Array ( [action] => woocommerce_update_order_review [security] => 5b6fd5503c [country] => SM [postcode] => 81569 [city] => asuncion [address] => nonombre [address_2] => 2 [s_country] => SM [s_postcode] => 81569 [s_city] => asuncion [s_address] => nonombre [s_address_2] => 2 

/this array*/

[post_data] => billing_anrede=Herr&billing_titel=Prof.&billing_first_name=Testing&billing_last_name=Testing+nachname&billing_address_1=nonombre&billing_address_2=2&billing_company=nonombre&billing_email=info%40as.com&billing_phone=%2B77+7789+78893&billing_postcode=81569&billing_city=asuncion&billing_country=SM&losung=&_n=3a2e28f947&_wp_http_referer=%2Fv2%2Fwp-admin%2Fadmin-ajax.php )
  • 写回答

1条回答 默认 最新

  • dongtangjie0495 2014-02-10 15:49
    关注

    You can use this PHP build in function parse_str

    $post_data = array();    
    parse_str($first_array['post_data'],$post_data);
    $item_you_want = $post_data[1]; //second
    $item_you_want = $post_data['billing_titel']; //second by key
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)