从数组中获取值

时间:2014-02-10 15:43:03

标签: php

我如何从第二个键[发布数据]中获取此值

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 

/ 此数组 * /

[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 个答案:

答案 0 :(得分:2)

您可以在函数parse_str

中使用此PHP版本
$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