i have this script
$content = string
if(!isset($_GET['page'])){
$page = 1;
}
else{
$page = $_GET['page'];
}
while($content[$limit]!= ' '){
$limit++;
}
print substr($content,($page-1)*$limit, $limit);
it works just fine first time (if the page is not set or page number is 1 )but if my page number is greater than 1 it splits my words. cause $limit is increased and even $limit is set to an offset that corresponds to a space character the start in the substr() function is increased too and it basically shifts the whole chunk and the last character that i get is not my wanted space but first couple of letters after the space.(i hope i made myself understood). how can i fix this problem? thanks