【发布时间】:2010-06-24 18:16:56
【问题描述】:
假设我有一个数组,我打印它:
print_r($myArray);
Array
(
[post] => 333434kj
[test] => wOVvc
[tytytyty] => xyzsalasjf
)
这个数组被分配给一个 CURL Post:
curl_setopt($ch, CURLOPT_POSTFIELDS, "field1=".$f1."&field2=".$f2."&something=True");
由于“field1”等于“post”并且$f1等于“333434kj”等,我很难弄清楚如何将键和值实现为变量,如[post], [test] 和 [tytytyty] 每次运行时都会更改值。如何让每个键成为变量,每个值成为变量?
【问题讨论】: