PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Feb 21, 2020 1:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Stripping paragraphs
PostPosted: Wed May 08, 2002 2:05 pm 
Offline
Forum Newbie

Joined: Wed May 08, 2002 2:05 pm
Posts: 1
Hey all,

I would like to query the database and if the result comes back with multilple sentences I would like to take the paragraph and strip everything except the first sentence. I'm sure there is a tag out there to do so. I looked through the manual and couldn't come up with much.

Thanks for the help


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 08, 2002 4:42 pm 
Offline
Forum Contributor

Joined: Sun Apr 28, 2002 9:52 pm
Posts: 122
Location: Portsmouth, VA


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 08, 2002 8:22 pm 
Offline
Forum Contributor

Joined: Thu May 02, 2002 11:51 am
Posts: 101
Location: New Mexico, USA


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 08, 2002 10:14 pm 
Offline
Forum Contributor

Joined: Sun Apr 28, 2002 9:52 pm
Posts: 122
Location: Portsmouth, VA


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 09, 2002 7:30 am 
Offline
Site Admin
User avatar

Joined: Fri Apr 19, 2002 8:29 am
Posts: 175
Location: Dallas, Tx
yes, but remember - if there's anything in that sentence that has a period in it, you're screwed...

for example; "I'm not quite sure that http://www.phpdn.com is cool enough."

Your example there would have a hayday with that one ;)
-enygma


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 09, 2002 7:48 am 
Offline
Forum Contributor

Joined: Thu May 02, 2002 11:51 am
Posts: 101
Location: New Mexico, USA


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 09, 2002 8:09 am 
Offline
Site Admin
User avatar

Joined: Fri Apr 19, 2002 8:29 am
Posts: 175
Location: Dallas, Tx
you might also try something like

ereg("^[a-zA-Z]*. ",$body,$output);

I'm not sure if that would work correctly, but it's an idea, since most sentences are generally ended with a period and a space or two...
-enygma


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group