I thought about implode() already, but it doesn't implode the key with it. If foreach it necessary, is it possible to not nest the foreach? EDIT: I've changed the string
How to implode array with key and value without foreach in PHP
31 No, the way that you're doing it is just fine. implode() only takes 1-2 parameters (if you just supply an array, it joins the pieces by an empty string).
So although explode and implode are unarguably way more dramatic-sounding, I would vote for join as a more universal way to express the concatenation of every value of an array into a string.
Implode an array with ", " and add "and " before the last item
Closed 1 year ago. Error: implode (): Argument #1 ($pieces) must be of type array, string given Here is my code and have been receiving same errors. What can I do?
How to use implode an array with commas but "and" before the last value? [duplicate] Asked 12 years ago Modified 12 months ago Viewed 145 times
How to use implode an array with commas but "and" before the last value ...
How to implode (reverse of pandas explode) based on a column Asked 5 years, 6 months ago Modified 3 years, 5 months ago Viewed 41k times
3 И да и нет. Если вопрос об SQL и операторе IN, то верно - заменяйте. Если вопрос о php то имейте в виду, что implode объединит значения вашего массива в строку "aaa,bbb,ccc", что в итоге приведёт в запросу ...