如何使用foreach
数组中的 PHP 创建以下内容?
var options = [
{text: "one", value: 1},
{text: "two", value: 2},
{text: "three", value: 3},
{text: "four", value: 4}
];
我的 PHP 数组如下所示:
Array
(
[0] => Array
(
[value] => 25000
[text] => 25,000
)
[1] => Array
(
[value] => 25000
[text] => 25,000
)
)