Jump to content


Photo

Limiting max characters


  • Please log in to reply
2 replies to this topic

#1 lice200

lice200
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 29 April 2006 - 11:36 PM

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

#2 cujo

cujo
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 30 April 2006 - 12:41 AM

Try this:

print substr($thestring, 0, $numchars) . "..."

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

#3 lice200

lice200
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 30 April 2006 - 08:26 PM

Thanks man




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users