I have this line

As you can see, it explicitly contains a new line. I want to split this message into an array of two messages, and I decided that I use it explode()in conjunction with PHP_EOL, to work with several OSs, but I was surprised since it did not work.
explode(PHP_EOL, $str); // Array( [0] => "Divakat has attacked Gergana, dealing 591 physical damage. ( 2 absorbed )
// Gergana has died." )
explode("\n", $str); // Array( [0] => ""Divakat has attacked Gergana, dealing 591 physical damage. ( 2 absorbed )", [1] => "Gergana has died." )
I would like to ask why the first example does not work as I expect, and is there a way to make it work, because I really would not want it to print a new line character there. Thank.
EDIT:
I forgot to mention that the message was created on the same computer as this code is currently being tested. No OS changes.
source
share