Jump to content

Archived

This topic is now archived and is closed to further replies.

lice200

Limiting max characters

Recommended Posts

Hello,
I am currently trying to find a way to limit the max characters shown not the max characters entered.

example:
Hello my name is lice, I am trying to write a script for my website that will allow me to set the max characters shown on the main page with a link to the full article.

This would be shown on a main page
Hello my name is lice... more <Link

Can you please push me in the right direction to where I could find something that will show me how todo this.

Thanks
-kick

Share this post


Link to post
Share on other sites
Try this:

[code]
print substr($thestring, 0, $numchars) . "..."
[/code]

Where numchars is the number of characters you want to limit the string to.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.