|
Posted by Peter Parker on 06/02/07 03:46
Sorry, it should have been '$article' instead of '$all'. I renamed and
missed that one when I posted onto newsgroup. The article format is created
by me so I make sure the format holds. I did print it out to verify. It
contains only text strings in English language with single newline as <br>
and double newlines for new paragraph as <br><br>. Thanks.
"Ivαn Sαnchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
wrote in message news:f3qns5$iis$1@hercules.cohp1...
> Peter Parker wrote:
>
>> $numberOfPages = ceil($length/$charsPerPage);
>
> This is plain false...
>
>> $cutOffPoint= strripos(substr($all, $start, $charsPerPage),
>> '<br><br>');
>> $pageContent = substr($article, $start, $cutOffPoint-$start);
>
> $cutOffPoint is relative to "substr($all, $start, $charsPerPage)", not
> relative to $article. By the way, why do you have $all and $article??
>
>
> Besides that, your algorithm doesn't take into account extreme cases: what
> if I have no "<br>" at all in my article? What if my article is nothing
> but
> a lot of "<br>"s?
>
> --
> ----------------------------------
> Ivαn Sαnchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> "Only sick music makes money today."
> -- Friedrich Nietzsche [1844 - 1900]
[Back to original message]
|