Mołot
Mołot

Reputation: 709

How to implode array elements, skipping first N elements?

My case is simple: I have an array of texts. I need to use first 2 of them as parameters, and then implode all the rest to a string, to create third parameter. I cannot know how many elements there will be.

Upvotes: 4

Views: 1249

Answers (1)

deceze
deceze

Reputation: 522135

foo($array[0], $array[1], join(',', array_slice($array, 2)))

Upvotes: 6

Related Questions