Implode array values

0 votes

My array:

Array
(
    [0] => Array
        (
            [name] => Something
        )

    [1] => Array
        (
            [name] => Something else
        )

    [2] => Array
        (
            [name] => Something else....
        )
)

Is there a simple way of imploding the values into a string, like this:

echo implode(', ', $array[index]['name']) // result: Something, Something else, Something else...
Jun 27, 2022 in PHP by narikkadan
• 63,600 points
401 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How foreach change original array values in php?

Hello @kartik, Do the following: foreach ($fields as $key ...READ MORE

answered Aug 14, 2020 in PHP by Niroj
• 82,840 points
8,729 views
0 votes
1 answer

How to store values from foreach loop into an array?

Hello @kartik, Declare the $items array outside the loop and ...READ MORE

answered Sep 1, 2020 in PHP by Niroj
• 82,840 points
30,047 views
0 votes
1 answer

How to remove duplicate values from an array in PHP?

Hello @kartik, Use array_unique(): Example: $array = array(1, 2, 2, 3); $array ...READ MORE

answered Sep 15, 2020 in PHP by Niroj
• 82,840 points
2,737 views
0 votes
0 answers

PHP using extract() to pass array values as variables and display it on a page

In order to include a specific file ...READ MORE

Aug 6, 2022 in PHP by Kithuzzz
• 38,000 points
1,316 views
0 votes
1 answer

How to get xdebug var_dump to show full object/array?

Hello. These are configurable variables in php.ini: ; with ...READ MORE

answered Apr 7, 2020 in PHP by Niroj
• 82,840 points
3,689 views
0 votes
1 answer

How to pass an array within a query string?

Hello, Submitting multi-value form fields, i.e. submitting arrays ...READ MORE

answered Apr 8, 2020 in PHP by Niroj
• 82,840 points
12,393 views
0 votes
1 answer

How to check if array is multidimensional or not?

Since the 'second dimension' could be just ...READ MORE

answered Nov 5, 2018 in Others by DataKing99
• 8,250 points
5,947 views
0 votes
0 answers

PHP multidimensional array search by value

I want to search for the uid ...READ MORE

May 30, 2022 in PHP by Kichu
• 19,040 points
1,073 views
0 votes
0 answers

PHP: implode() Invalid arguments passed

I am using Codeigniter and its validation ...READ MORE

Jun 13, 2022 in PHP by narikkadan
• 63,600 points
1,959 views
0 votes
0 answers

How to sum all column values in multi-dimensional array?

How can I add all the columnar ...READ MORE

Jun 19, 2022 in PHP by narikkadan
• 63,600 points
1,446 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP