Skip to content
Advertisement

PHP – 2D array to string

I would need this matrix represented by a 2d field

JavaScript

on a string in the form.

‘…. n

.XX. n

.XX.n

….’

Thank you in advance for any advice.

Advertisement

Answer

Use array_map() to call implode() on each element to get an array of strings. Then implode that to get a single string separated by n.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement