ksumanth Posted February 6, 2013 Share Posted February 6, 2013 hello friends, I have one paragraph , in that middle of the paragraph i just give "."(fullstop). If "." comes the sentence have to end. I know how to give the limitation of the words in paragraph but i want to know If "." comes then the sentence should end . can any one help me out. Thanks sumanth. Quote Link to comment https://forums.phpfreaks.com/topic/274085-in-paragraph-fullstop-ends-the-sentence-end-limitation/ Share on other sites More sharing options...
tibberous Posted February 6, 2013 Share Posted February 6, 2013 hello friends, I have one paragraph , in that middle of the paragraph i just give "."(fullstop). If "." comes the sentence have to end. I know how to give the limitation of the words in paragraph but i want to know If "." comes then the sentence should end . can any one help me out. Thanks sumanth. I'm guessing English isn't your native language? In PHP: <?php $s="Here is the first. Here is the second. Here is the third"; list($c) = explode('.', $s); $c .= '.'; echo $c; ?> That's probably the easiest way. Explode breaks the string into segments seperated by the period, and the list($c) = assigns the first array element to $c. The line $c .= '.'; just adds the period back onto the string. Quote Link to comment https://forums.phpfreaks.com/topic/274085-in-paragraph-fullstop-ends-the-sentence-end-limitation/#findComment-1410382 Share on other sites More sharing options...
ksumanth Posted February 6, 2013 Author Share Posted February 6, 2013 Thanks for the Reply i got this Quote Link to comment https://forums.phpfreaks.com/topic/274085-in-paragraph-fullstop-ends-the-sentence-end-limitation/#findComment-1410386 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.