Quote:
Originally posted by OrangeCow.net
Ok, I am working on making a news script for a new site... I have currently come up with these problems:
I want to show a snippet of the news post on the main page, but how can i restrict the number of characters that are displayed?
For example - "Yadda Yadda has died today after an assasination in his home..."
I only want it to display a certain number of characters or words, or whatever I can restrict! Can anyone help me with that?
|
For this use the SUBSTR() function like so...
PHP Code:
echo substr($MY_SNIPPET,0,100);
this would show the first 100 characters in that snippet.