PHP’s implode is a pretty handy function to flatten any array into a single string value, using any piece of ‘glue’ (basically a substring) that you specifiy to put everything together. Note: The implode() function accept its parameters in either order. Using json_encode() function Using implode function Using Serialize function Using json_encode() function to convert an Array to a string To convert […] Of course, extending this function to handle multi-dimensional arrays (or matrices if you prefer) is a pretty simple matter of quickly whipping up a recursive version and so without any further waffling from my side, here’s the code: Usage is pretty simple. You can also convert between strings and arrays by using the PHP implode and explode functions: implode implodes an array to a string, and explode explodes a string into an array.. For example, say you want to put an array's contents into a string. my goal is to create a string like this: 1603,1802,2255. but i start out with this multidimensional array: Array ([0] => Array ([device_id] => 1603 (13) Administrative / Clerical Jobs, Accounting / Finance jobs, Architecture Jobs, Art and Design Jobs, This is possibly an amateurish solution, but it does what you want. PHP implode Function is an inbuilt function of PHP.