我有这个数组
array(1) { [0]=> array(5)
{ ["ppc_acc_name"]=> string(9) "Test test"
["ppc_acc_username"]=> string(4) "ttes"
["ppc_acc_password"]=> string(3) "tes"
["ppc_acc_answer"]=> string(3) "trt"
["ppc_acc_link_client"]=> string(1) "3" } }
我试图通过 foreach 循环访问数组中的值。我想使用密钥字符串标识符,这样我就可以控制循环输出的格式。问题是它不允许我在我的 foreach 循环中使用键字符串标识符。
此循环输出正确的 Test test ttes tes trt 3
<?php foreach ($ppcAccDetails as $details): ?>
<?php foreach ($details as $detail): ?>
<?php echo $detail." "; ?>
<? endforeach; ?>
<? endforeach; ?>
但我想使用键 $detail['ppc_acc_name'] 结果只输出第一个字符。
结果不正确:T ttt 3