我的陣列結構的值是我需要得到陣列
Array
(
[customer_id] => Array
(
[0] => Array
(
[customer_id] => 123
)
)
[menu_item_net_price] => 1700
[menu_item_tax_price] => 4%
[menu_item_gross_price] => 1700
[provider_id] => 123
)
我需要得到的[customer_id] => 123
值。告訴我我該怎麼做?
不過我的問題還沒有解決,所以我張貼代碼:
$data['customer_id'] = $this->session->userdata('id');
$data['menu_item_net_price']= $netPrice;
$data['menu_item_tax_price']= '4%';
$data['menu_item_gross_price']= $netPrice;
$data['provider_id']= 123;
echo '<pre>';
print_r($data);
echo '</pre>';
exit(0);
你確定你問過編輯正確的問題?也許你需要把'customer_id'放入數組中? – VisioN
*(reference)* http://php.net/arrays – Gordon