I have a long string consisting of a series of sentences separated by a single quote.
Example:
This\'s sentence number 1'This\'s sentence number 2'
Notice that the string has single quotes part of the sentence itself which are escaped. I need to explode the string using single quote, but not the escaped single quote.
The output should be:
Array{
[0]=>This\'s sentence number 1
[1]=>This\'s sentence number 2
}
Basically I need to explode the string on { ' }, but not { \' }. Thanks in advance.
Try this: