Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How can i limit a certain amount of characters ni a string?

    like for example if they go over 300 characters then it only outputs the first three hundred. if anyone knows that would be great, lol ive tried so much, but unforutnatly i dont know the function.

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $first_300 = substr($the_complete_string, 0, 300);

  • #3
    Regular Coder
    Join Date
    Oct 2002
    Location
    Milwaukee, Wisconsin
    Posts
    123
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanx alot man youve been a great help! what im using it for is a new forum system and istea do of making the user go back and reedit their sig and stuff it eliminates the characters. lol you just saved me like 2 days of work, i would have never guessed it was substr. so once again thanx alot.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •