first few characters only


Posted on 16th Feb 2014 07:03 pm by admin

hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have seen this in many news sites where the news story headline reads like "woman found in obama's bedroom today at....... read more. ('read more' is a link)

what i am looking for is something that says i will take the first 100 characters of the entry and then print "...read more" as a link to the full story.

thanks

No comments posted yet

Your Answer:

Login to answer
246 Like 28 Dislike
Previous forums Next forums
Other forums

Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.

Here is the

unexpected T_STRING
error log "[Sat Jan 09 18:27:58 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error

updating a single value to multiple non consecutive rows
I need to update the same value to multiple non consecutive rows. I need to add an experation date t

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

Referential Integrity problem when inserting into 2 tables at same time
Hello Everyone,

Im relativity new to PHP and MySQL and i have come up against a problem. i h

need help in update query
i create a form for update. there are 8 columns in my mysql table. on my main page all the data is r

Writing Windows Device Drivers with C
Yes: one of the nice features of C is void*. You can put anything there and get anything out. Very

Change snippet to use CURDATE
I am using time() in the snippet below, I would like to use CURDATE() and have the database setup fo

Check Digits and extracting digits
I think I can figure out the code for this but I am having a very hard time getting past the first s

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash