php method to convert an array into a string: first create a PHP sample file; then define an array; then convert the array into a string through the "implode(',',$arr);" method; Finally, the conversion result can be output through echo.
Recommended: "PHP Video Tutorial"
The code example is as follows:
$arr = array(1,2,3,4,5,6,7); echo implode(',',$arr); //结果:"1,2,3,4,5,6,7" echo implode('-',$arr); //结果:"1-2-3-4-5-6-7"
The above is the detailed content of How to convert array into string in php. For more information, please follow other related articles on the PHP Chinese website!