Tuesday, 20 August 2013

Combine Array Keys PHP

Combine Array Keys PHP

I have an array that can contain one more more key. What I would like to
do is if there are more than one key for that array to comma separate the
two values
I need to enter 6,7 in a database field where order number is 23489, but
not sure how to go about that. All the others are okay in this instance as
they only have the one key.
array
239489 =>
array
0 => string '6' (length=1)
1 => string '7' (length=1)
329048 =>
array
0 => string '10' (length=2)
908423 =>
array
0 => string '11' (length=2)
'239489-1' =>
array
0 => string '8' (length=1)

No comments:

Post a Comment