You are here: Re: pagination « PHP Programming Language « IT news, forums, messages
Re: pagination

Posted by Ivαn Sαnchez Ortega on 06/02/07 03:25

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]

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация