b00ker_b0y Posted July 24, 2007 Share Posted July 24, 2007 Hello people. Need a way to cut up a block of text by only selecting the first 2 Sentences and keeping the full stops in tact, but ignoring everything (including full stops) after the firest 2 sentences? i.e. Sentence 1. Sentence 2. Sentence 3. Sentence 4. Sentence 5. Sentence 6. required: Sentence 1. Sentence 2. any thoughts? Thanks. Quote Link to comment Share on other sites More sharing options...
jitesh Posted July 24, 2007 Share Posted July 24, 2007 $str = "Sentence 1. Sentence 2. Sentence 3. Sentence 4. Sentence 5. Sentence"; $str_arr = explode(".",$str); echo $str_arr[0].$str_arr[1]; Quote Link to comment Share on other sites More sharing options...
b00ker_b0y Posted July 24, 2007 Author Share Posted July 24, 2007 Cheers Very Much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.