Preg_split on 2 characters
Preg_split on 2 characters Im trying to split a string on 2 variables (T & +) which when using on "2018-06-25T10:32:00+01:00" will split it to:- [0] => 2018-06-25 [1] => 10:32:00 [2] => 01:00 So I thought I could use "preg_split("/ (T|+) /", $ent)", but it itsnt working at all. My code I have (in PHP) is:- $ent = "2018-06-25T10:32:00+01:00"; print_r(preg_split("/ (T|+) /", $ent)); Any ideas what Im doing wrong? Remove the spaces – Philipp Jul 2 at 9:43 That worked, thank you :-) Sorry, Im a newbie at this – Tony Cross Jul 2 at 9:57 Why do you parse dates using regex ? PHP provides the DateTime classes t...