Na razie robię tak:
$marker = '<!--BREAK PAGE-->'; $pageNo = $pageIntval-1;
A więc jak to przerobić, aby tekst dzieliło dopiero po kropce, a nie przerywało w połowie zdania?
$marker = '<!--BREAK PAGE-->'; $pageNo = $pageIntval-1;
$text = '1fsda fsdafsadfs. 2fdsa fsad fsdaf sadf as. 3fdsa fsadjfsadofjsdfa. 4f dsafasdjfsadlfjasdlkfa. 5fsad fsdaf sadf a. 6fjdsalfjsadlkfjsda. 7fsdajflksdajfals.'; $treshold = 30; // number of characters per page $whole_text = ''; $i=1; foreach($sentences as $sentence) { { $whole_text .= $sentence."."; $current_part .= $sentence."."; { $whole_text .="<!--BREAK-->"; $current_part = ''; ++$i; } } }
{ $page = (int)$_GET['page']-1; }else { $page = 0; }