将数组转换为字符串 [英] Convert an array to a string

查看:75
本文介绍了将数组转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

将PHP数组字符串转换为数组

哪个函数可用于转换

推荐答案

您可以使用 implode() 函数来转换数组成字符串:

You can use the implode() function to convert an array into a string:

$array = implode(" ", $string); //space as glue

如果要将其转换回数组,可以使用explode函数:

If you want to convert it back to an array you can use the explode function:

$string = explode(" ", $array); //space as delimiter

这篇关于将数组转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆