2

I have a multidimensional associative array that I run through and grab a specific value that is then echoed out.

foreach ($multi_array as $entry) {

   echo $entry['tag_id'];

}

It echos 12. What function could I use to convert it to...

`1`,`2`

1 Answer 1

2

You are looking for the implode function, try this:

$result = '`' . implode('`,`', $multi_array) . '`';
Sign up to request clarification or add additional context in comments.

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.