数据处理难题!求解 我有一大段数据,用“,”分开,现在需要处理他,“,”为分割符,在每个数据前加上多选框,多选框id升幂排列 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 $str = 'xxx';$arr = explode(',',$str);foreach($arr as $i=>$v){ $arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v}//到这里就可以了//如果要把数组转成字符串的话就接着:$out = implode($arr);echo $out ; $str = 'xxx';$arr = explode(',',$str);foreach($arr as $i=>$v){ $arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v ;}//到这里就可以了//如果要把数组转成字符串的话就接着:$out = implode($arr);echo $out ; $arr = explode(',',$str);sort($arr);//升序排序一下foreach($arr as $i=>$v){ $arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v ;}//到这里就可以了 $res = $this->db_Scope1->get_scope_info($opts, $this->cache); $list = $this->db_Scope1->get_scope_list($opts, $this->cache); $res['list_scope']= explode(',',$res['list_scope']); sort($res['list_scope']); foreach ($res['list_scope'] as $i=> $v) { $res[$i]='<input type="checkbox" id="'.$i.'" />'.$v ; } $res['list_scope'] = $list; var_dump($res['list_scope']);中间的$res['list_scope']);里面有个demand字段需要上述处理 php 传值 PHP 正则表达式 进行模糊查询 PHP @用法 最近在写采集的时候关于字符编码遇到难题了,请教大家 大家来聊下网页制作! php中弹出对话框时如何保留原来的页面显示(对话框的弹出用Js实现)? 如何做这种菜单 求教一个例子(请进来看一下) 如何将@die('导入数据失败。请确认文件是否正确并未被其它进程占用!'); 提示信息在两文件传递并继续执行另外的语句 求助,post提交表单中文出现乱码 每输入一个字或字母都要调用一js方法,在线等 老问题刚解决,新问题来了,来看看我的Php用的哪个数据库?
$arr = explode(',',$str);
foreach($arr as $i=>$v){
$arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v
}
//到这里就可以了//如果要把数组转成字符串的话就接着:
$out = implode($arr);
echo $out ;
$str = 'xxx';
$arr = explode(',',$str);
foreach($arr as $i=>$v){
$arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v ;
}
//到这里就可以了//如果要把数组转成字符串的话就接着:
$out = implode($arr);
echo $out ;
sort($arr);//升序排序一下
foreach($arr as $i=>$v){
$arr[$i]='<input type="checkbox" id="'.$i.'" />'.$v ;
}
//到这里就可以了
$res = $this->db_Scope1->get_scope_info($opts, $this->cache);
$list = $this->db_Scope1->get_scope_list($opts, $this->cache);
$res['list_scope']= explode(',',$res['list_scope']);
sort($res['list_scope']);
foreach ($res['list_scope'] as $i=> $v)
{
$res[$i]='<input type="checkbox" id="'.$i.'" />'.$v ; }
$res['list_scope'] = $list;
var_dump($res['list_scope']);中间的$res['list_scope']);里面有个demand字段需要上述处理