How to make \r\n endured a string in PHP?

There is a cell in the database table, the code below generates the contents:
$log = ";
$log = $log.'\n\r\ User uploaded';
$log = $log.'\n\r\ User changed his name from '.$fname.' on '.$_POST['fname'];
DB::update('update users set log = ?', [$log]);

And why the \n\r\ displayed as part of the text, not the newline.
If a request directly paste \n\r\ and the text - the line breaks will work, so I understand what the problem is in PHP.

How to fix it?
Thank you for your attention.
March 20th 20 at 11:43
1 answer
March 20th 20 at 11:45
Solution

Find more questions by tags PHP