Page 1 of 1

split a string after 50 characters

Posted: Mon May 19, 2008 3:40 am
by w35z0r
I'm currently trying to split a string after a certain number of characters (say, 50). Basically, I want $bigString to turn into $firstFifty and $everythingElse.

I'm doing this for a article displayer. The idea is that it displays the first 50 characters of the article and a [...] at the end of that. I have a javascript function that activates when the [...] is clicked so that the rest of the article is displayed.

Thanks much for your time.

Re: split a string after 50 characters

Posted: Mon May 19, 2008 4:31 am
by onion2k
Use substr().

Re: split a string after 50 characters

Posted: Mon May 19, 2008 4:41 am
by w35z0r
=0

Awesome, thank you! Its.... defiantly 5 in the morning... heh...