Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

Formatting a paragraph

I have two questions. One - I was wondering if there was a function to format grammatical errors in php. Say, for instance I do not put a space after a period, is there a function that is already incorporated in the language to fix that. And two - I am trying to do what I just said above (about the periods). I am trying to put a space after the periods in the following paragraph if there is not a space already after it:

Swingline 48207 Optima Grip Electric stapler, Jam Free Stapling, 20 Sheets Compact design lets you take reliable automatic stapling wherever you need it.Intuitive user control puts you in charge of either automatic or manually activated stapling.Includes stack height gauge and staple placement guides.Plug-in or battery operation.
Not totally understanding your question, but the implode() function may be what you are looking for.
Ok, implode. I would have to use an array for that right?

I got it:

Code
$string = implode('. ', explode('.', $string));

Thanks VipVince!
PHP Code

<?php 
str_replace
(".", ". ", $string); 

Use str_replace, replace $string with the text you want to fix.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by Tɦɛ AlexMay 18, 2016 03:26 PM 2 103 May 18, 2016 03:26 PM
Last Post: Tɦɛ Alex
[PHP] by mothhMar 16, 2016 02:49 AM 9 166 Mar 16, 2016 02:49 AM
Last Post: mothh
[PHP] by +HazeOct 11, 2014 04:39 PM 17 256 Oct 11, 2014 04:39 PM
Last Post: Eight