Array (
[0] => Array (
[0] => 21
[SLOTID] => 21
)
[1] => Array (
[0] => 4
[SLOTID] => 4
)
)
I want to create a new string from this array like:21,4
.
asked Apr 6, 2012 at 20:11
-
1Use implodehjpotter92– hjpotter922012年04月06日 20:13:22 +00:00Commented Apr 6, 2012 at 20:13
2 Answers 2
$str = $arr[0][0] . ',' . $arr[1][0];
answered Apr 6, 2012 at 20:16
1 Comment
Paul
@AwladLiton What do you want to do when you have more values? Create more strings, or modify that one string to be longer, or is this good enough?
Here is the standard way to do this
implode(",",$arr)
Comments
lang-php