Page 1 of 1

Split dynamic content

Posted: Mon May 17, 2004 9:15 am
by gdog
Hello,

I have been working on a new site for ages trying to come up with a good way to cleanly split up content using PHP or Javascript.

Basically what I want to do is split dynamic content that includes links in to certain length chunks and not just cut off the string in the middle of a link. The length will be determined by the current users font-size.

Is there a PHP function that does this by any chance or do you know of one, javascript also.

Thanks

GDog

Posted: Mon May 17, 2004 10:53 am
by lostboy
I would use a combo approach here:

1. get the user settings via js
2. pass that data back to server
3. query your data
4. use some if/then or case/swtich statements to modify the data to limit the length (ie explode it to an array and take only the first x values and recombine them into a string for display to the user