PHP Array Conversion problem
How to Put
Array
(
[Strwarenum] = = Array
(
[0] = 1
[1] = 1
)
[Strwareid] = = Array
(
[0] = 80
[1] = 79
)
)
Converted to
Array
(
[Strwareid] =, 78,80
[Strwarenum] =,
)
And can be called separately.
PHP
------Solution--------------------
Set your original array to $ A, and build an empty array that you need to include all the keys $b (your example some keys are not in $ A, so build separately)
I don't know about you.
+Where does this value come from, for the time being when you're hitting 79 wrong
I am too lazy to write the assignment part, but also to change your code, trouble, write it Yourself
foreach ($b as $k = = $v) {
$a [$k][]= ';
$v =array_reverse ($a [$k]);
}
Var_export ($b);
Self test
------Solution--------------------
$arr = your array;
foreach ($arr as & $v) {
if (Is_array ($v)) $v = ', '. Join (', ', $v);
}
Print_r ($arr);