May 4, 2011

PHP to get X sentences from article | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
PHP to get X sentences from article
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
July 25, 2012
12:12 pm
Avatar
DrumAndBasslines
Guest
Guests

Do you think this code is ok to get the first 6 sentences from a post from a feed?

Login to see the code

Ive added the </p> to it to ensure that any paragraph that has been started is then closed. Do you see that as a problem or it look ok?

July 25, 2012
12:54 pm
Avatar
DrumAndBasslines
Guest
Guests

actually needs to be imploded back to string :

Login to see the code

That better?

July 25, 2012
4:54 pm
Avatar
CyberSEO
Admin
Forum Posts: 3947
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

I don't think it's a good idea to add "</p>" at the end. The best idea is to strip off all the excessive tags (like paragraphs and line breaks). E.g.:

Login to see the code

July 25, 2012
10:46 pm
Avatar
DrumAndBasslines
Guest
Guests

yes thats worked. Thanks !!!

July 25, 2012
11:04 pm
Avatar
DrumAndBasslines
Guest
Guests

hmm actually. if you check on here : Login to see this link

you will see the same indentation problem on a list. I have tried with and without the </p> on the end and your method but from looking at the page source it looks like it is missing the /p :

Login to see the code

July 25, 2012
11:41 pm
Avatar
DrumAndBasslines
Guest
Guests

got it and just closed that annoying div tag and it works !!!

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
207 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 68

Freedom: 61

Pandermos: 54

MediFormatica: 49

B8europe: 48

Member Stats:

Guest Posters: 337

Members: 2855

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1641

Posts: 8353

Newest Members:

samuel2288, comercios.cercademi, wanmarkets, torontomark48, info.ckmedianetwork, contact.mybeautystar

Administrators: CyberSEO: 3947