...

View Full Version : How can i limit a certain amount of characters in a string?



stoodder
12-09-2003, 10:07 PM
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.

raf
12-09-2003, 10:49 PM
$first_300 = substr($the_complete_string, 0, 300);

stoodder
12-10-2003, 02:45 AM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum