mysql中怎么拆分以逗号隔开的字符串
拆分以逗号隔开的字符串,这是高级语言来处理的吧,数据库主要是存储数据的,比如php就可以这样实现:$string = '1,2,3,4,5';$array = explode(',',$string);之后就得出一个数组,$array(1,2,3,4,5);
在PHP中提取字符串中第一个数字
测试过,符合要求
$str="登山服:5620A登山服";
$search1 = implode("-",range("a","z"));
$search2 = implode("-",range("A","Z"));
$search3 = implode("-",range(0,9));
$search4 = implode("-",array(":"));
$search = $search1."-" .$search2."-" .$search3."-" .$search4;
$oldarr = explode("-",$search);
$newarr = array();
foreach($oldarr as $value)
$newarr [] = "{mysplit}";
$str = str_replace($oldarr, $newarr, $str);
$arr = explode("{mysplit}",$str);
echo $arr[0];