Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Certain # of characters on page, than makes new page
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
poly




PostPosted: Thu Aug 07, 2003 11:16 pm   Post subject: Certain # of characters on page, than makes new page

How would you do something like say you only want 1000 characters on a page and anything more than that than a script would break it up into 2 pages, sort of like example here, lets just say there is a limit to 1000 characters to page in the example:

User inputs article using form...
script scans the article and determines how many characters
if there are less than 1000 characters than its one page, but if it is more than 1000 characters than it would break it up into 2 or maybe 3 pages etc. But say if the "r" in the word "word" is the 1000 character, than the script would make it so that "word" appears on next page
Sponsor
Sponsor
Sponsor
sponsor
Amailer




PostPosted: Fri Aug 08, 2003 1:44 am   Post subject: (No subject)

Do you want this to be done with or with out MYSQL?

what i mean is, is the articals information be from a database?
Homer_simpson




PostPosted: Fri Aug 08, 2003 4:29 am   Post subject: (No subject)

int strlen ( string str) returns size of a string
poly




PostPosted: Fri Aug 08, 2003 11:13 am   Post subject: (No subject)

well with MySQL.... (string str) ok i get that, but how do u make sure about a whole word not getting cut off
Amailer




PostPosted: Fri Aug 08, 2003 1:07 pm   Post subject: (No subject)

I know,

How about we count the number of spaces?
Much simpler?

code:

function wrdcnt($haystack) {
echo substr_count($haystack,' ') + 2;
}


$haystack = "This is just a lil test OK!?!";

wrdcnt($haystack);


got that off:
http://ca3.php.net/manual/en/function.str-word-count.php
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: