Home  >  Article  >  php教程  >  CKeditor的分页问题

CKeditor的分页问题

WBOY
WBOYOriginal
2016-06-06 19:32:37996browse

源码出处: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;
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn