Kirby

Helper function to format an array in a comma separated list?

Hi,

Is there a Kirby helper function to format an array in a comma separated list, I need it to update a multiselect field.

Or do I need to loop on the array and build the comma separated list myself?

Sorry, the PHP implode() function do the job

implode( ", " , $array )

Hrm, I thought there was a helper for that as part of the array stuff.

Me too, I checked this page but didn’t find anything …

No, the A class doesn’t replace every possible PHP array method. It just provides some methods for fetching, merging or sorting arrays to make dealing with arrays easier and more consistent in this respect.

Yes makes sense, implode() is perfect fot my need :slight_smile:

Apart from that, implode() counts as a PHP string function, not an array function.