Split dynamic content

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gdog
Forum Newbie
Posts: 1
Joined: Mon May 17, 2004 9:15 am
Location: London

Split dynamic content

Post 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
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post 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
Post Reply