如题所述
第1个回答 2012-08-22
方法1:
"'".str_replace(",","','",""1,2,3,4"")."'" 替换法
方法2:
"'".implode("','",explode(",","1,2,3,4")."'" 数组法本回答被提问者和网友采纳
"'".str_replace(",","','",""1,2,3,4"")."'" 替换法
方法2:
"'".implode("','",explode(",","1,2,3,4")."'" 数组法本回答被提问者和网友采纳
第2个回答 2012-08-21
$str = "1,2,3,4";
$newStr = explode(",",$str);
$str = "'".$newStr[0]."', '".$newStr[1]."', '".$newStr[2]."', '".$newStr[3]."'";
DONE!
$newStr = explode(",",$str);
$str = "'".$newStr[0]."', '".$newStr[1]."', '".$newStr[2]."', '".$newStr[3]."'";
DONE!