我正在使用多个数组操作处理一个项目。PHP - 如何将多个键值数组转换为| (Pipe)分隔字符串
我有一个变量叫$ product_attributes它包含下面的数组作为值。
Array
(
[0] => Array
(
[0] => Applications
[1] => Steel; PVC; Std. Wall
)
[1] => Array
(
[0] => Blade Exp.
[1] => 0.29
)
[2] => Array
(
[0] => Fits Model
[1] => 153
)
)
现在我想将它转换为| (管)组成的字符串象下面这样:
Applications=Steel; PVC; Std. Wall|Blade Exp.=0.29|Fits Model=153
下面是什么我曾尝试:
$tags = implode('|',$product_attributes);
echo "Output".$tags;
但如下返回输出:
OutputArray|Array|Array|Array|Array|Array
这或许有助于http://stackoverflow.com/questions/16710800/implode-data-from-a-multi-dimensional-array –