The usage of PHPimplode () is similar to that of explode (), but the function is the opposite. implode () combines array elements into a string.
The usage of PHP implode () is similar to that of explode (), but the function is the opposite. implode () combines array elements into a string.
The above is a simple one-dimensional array, so the multi-dimensional array row does not work?
The result is:
A, B, Array, c, d, e, Array
Obviously, the implode () function is powerless for multi-dimensional arrays! How to convert a multi-dimensional array to a string? If you convert a multi-dimensional array into a one-dimensional array and then combine it into a string using the implode () function, will that be done! For details about how to convert multi-dimensional arrays to one-dimensional arrays, refer to this Article. PHP simple implementation of multi-dimensional arrays to one-dimensional arrays