[eluser]xwero[/eluser]
using
Code:
function wordcount($str) {
return count(array_filter(explode(' ', $str)));
}
function wordlimiter($str,$start,$end){
$temp = array_filter(explode(' ', $str));
return array_slice($temp,$start,$end);
}
you could split up the article for instance in three parts
Code:
$words = wordcount($row->content);
$partwordsnr = floor($words/3);
$parts = array();
$start = 0;
$end = $partwordsnr;
for($i=0;$i<3;$i++)
{
$parts[] = wordlimiter($row->content,$start,$end);
$start = $partwordsnr;
$end = $count+$partwordsnr;
}
Then in the view you could do something like
Code:
<div class="articlecontent">
<?php foreach($parts as $part){ ?>
<div class="articlepart"><?php echo $part; ?></div>
<?php } ?>
</div>
It's ruff code but it might give you some idea on how you can accomplish what you want.
update : code mistake