php拆分字符串 php如何用逗号把字符串分割为数组并把数组分别写入数据库?

php如何用逗号把字符串分割为数组并把数组分别写入数据库?您可以使用expand函数$STR=“1,2,3,4,5,6”$arr=expand(“,”,$STR)foreach($arr as$a){

php如何用逗号把字符串分割为数组并把数组分别写入数据库?

您可以使用expand函数$STR=“1,2,3,4,5,6”$arr=expand(“,”,$STR)foreach($arr as$a){insert into database}