| | |
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 |
301 apache api array autosuggest beginner binary broken cakephp checkbox class cms code compression cron curl data database date display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google href htaccess html httppost if...loop image include insert ip javascript joomla jquery key library limit link links login mail md5 menu mlm multiple mysql mysql_real_escape_string oop paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search searchbox server session sessions sms sorting source space sql syntax system table tutorial update upload url validator variable video volume votedown web website youtube zend





