0
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.

1
  • 1
    Use implode Commented Apr 6, 2012 at 20:13

2 Answers 2

1
$str = $arr[0][0] . ',' . $arr[1][0]; 
Sign up to request clarification or add additional context in comments.

1 Comment

@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?
0

Here is the standard way to do this

implode(",",$arr)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.