I cant seem to figure the best approach to a PHP problem. I want to accomplish the following
- I get a string that is, ie. 1000 characters in lenght
- I want to split a string into 2.
- The first string need to be 600 characters based on the following condition:
a) String should only be split if after a period - The second section of the string can be the remainder.
I know how to check the length of a string strlen($string) and I know how to explode a string into substrings using ie. explode(). However, I am not sure how to bring everything together.
I have used, its works.. you have try this…