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

Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would

split values
I have values that are returned to me in this format:

name=>test,age=>49

Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as

Calculating a rating by adding number of points and dividing by number of items
I have a site that users can post links to files to download. They can rate these files on a 1-5 sca

Echoing ASCII code
I have a php page that splits a string into chars and then echoes the ASCII code for each char. I'm

Php navigation
I have four buttons on a php page.
If i click a button it will redirect to different php pages.

Send inserts to mysql thru port 80
Hi!

I have an application that must do some inserts in a mysql db. This db is behind a firewa

Get last modified date of web page
Hai All,

In php how can i get last modified date of a give web page . I have tried to g

PHP submit form script causing blank page
Im trying to submit a form using this script, however nothing shows up on the page, does anyone know

MII Netweaver Server stopped due to CPIC connection Problem
Dear Experts,
We have SAP XMII 12.0 setup running on Netweaver 2004s,7.0, Java Stack only.

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