| | |
How to split text into pages?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hi ,
I have a text field in a table and i would like to split it into pages for viewing pleasure. I know how to split it into set of pages if it is in rows. But i couldn't get clue how to split a lengthy text field into pages which is present in a single column of a table.
Any ideas or guidance will be very helpful to me.
Thanks!
I have a text field in a table and i would like to split it into pages for viewing pleasure. I know how to split it into set of pages if it is in rows. But i couldn't get clue how to split a lengthy text field into pages which is present in a single column of a table.
Any ideas or guidance will be very helpful to me.
Thanks!
•
•
•
•
well you could use a paginator
and count the number of words in the entire 'book' then each word i part of an array and you just output a certain number of array items per page.....specified in the paginator settings.
What actually is a paginator? Is it a set of code lines? i googled little after seeing your post about it.
Do you recommend any specific paginators?
OR
shall i make use of some string syntax to count total words in a text and split it into number of words resulting in a page? If i follwo this method, then it might result in awkward splitting where it might break a sentence even before it ends.
So.. if i use somthing like display till a full stop is encountered , then if a code is present then
again its a problem.Please suggest something. Thank you.
Last edited by csharplearner; May 23rd, 2009 at 11:19 pm.
you could go like this.....
you could even split it up by sentences. by using the delimiter in the explode function as '.'
PHP Syntax (Toggle Plain Text)
$string = 'this is a small sample sentence that should be split up'; $words = explode(' ', $string); for($i = 0; $i = count($words); $i++){ echo $words[$i] . '<br />'; }
you could even split it up by sentences. by using the delimiter in the explode function as '.'
Last edited by sacarias40; May 23rd, 2009 at 11:34 pm. Reason: forgot something
no dejes para mañana lo que puedes hacer hoy
•
•
•
•
if you would like i can send you a paginator class that i made if that would help you.
sacarias40. I really appreciate it.I would like to give it a try first with the hints you have given and later if unsuccessful
i shall certainly ask your help again for the class file you made. ![]() |
Similar Threads
- How to split text box input value and compare to char (VB.NET)
- Split a text file based on criteria problem (VB.NET)
- determining frequency of words in text file (Python)
- Split text and store it in arraylist [ problem with code] (Java)
- problem with stdin (Python)
- VB newbie: text file manipulation (VB.NET)
- explode text into array (C++)
- Text Adventure -- Classes (Python)
Other Threads in the PHP Forum
- Previous Thread: .php url problem
- Next Thread: if statement /mysql help please
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





