Hello I need split a String by “.”
Have :
$string = "Step one (30 min aprox.).Step two.Step three $12.00. Step four ud. visit ";
With:
preg_split('/[.]/', $string)
I get:
array(7) {
[0]=>
string(22) "Step one (30 min aprox"
[1]=>
string(1) ")"
[2]=>
string(8) "Step two"
[3]=>
string(14) "Step three $12"
[4]=>
string(2) "00"
[5]=>
string(13) " Step four ud"
[6]=>
string(7) " visit "
}
I just want this
[0] Step one (30 min aprox.)
[1] Step two
[2] Step three $12.00
[3] Step four ud. visit
The previous character (before ‘.’) cannot be a number or special char and the next character must be an uppercase letter.
NOTE: Step * is just a example
Hope help thanks!
If you want a more general case, this might help.
I have not tested it, but I think it will do what you want.