源码出处:http://www.codephp.cn/html/tools/editortool/2013/1205/17.html 无 源码与演示: 源码出处演示出处 $strArr = preg_split('/div[^].*page-break-after:\salways(;)?[^].*([^].*)\/div/',$_POST['descr'],null,PREG_SPLIT_NO_EMPTY);$count = coun
源码出处:http://www.codephp.cn/html/tools/editortool/2013/1205/17.html
源码与演示:源码出处 演示出处
$strArr = preg_split('/<div[^>].*page-break-after:\salways(;)?[^>].*>([^>].*)<\/div>/',$_POST['descr'],null,PREG_SPLIT_NO_EMPTY); $count = count($strArr); if($count>1){ $outstr = '<div id="page_break">'; foreach($strArr as $_k=>$_v){ if($_k<=0){ $outstr .='<div id="page_'.($_k+1).'">'.$_v.'</div>'; }else{ $outstr .='<div id="page_'.($_k+1).'" class="collae">'.$_v.'</div>'; } } $outstr .='<div class="num">'; for($i=0;$i<$count;$i++){ $outstr .='<li>'.($i+1).'</li>'; } $outstr .="</div></div>"; $_POST['description'] = $outstr; }