KingKongFrog
KingKongFrog

Reputation: 14429

What is the best way convert a PHP associate array to a string that has only values

$columns = array(
    'Team 1' => 'baltimore',
    'Team 2' => 'michigan'
);

How do I convert this to a string =>

baltimore, michigan

Upvotes: 0

Views: 57

Answers (1)

DarkSide
DarkSide

Reputation: 3709

$string = implode(', ', $columns);

or

$string = join(', ', $columns);

Upvotes: 3

Related Questions