i have tried many solutions but couldn't figure out the issue. I have a object with some properties. This is my object
object(room)[16]
public 'id' => string '144323'
public 'jobId' => string '115141'
public 'name' => string 'Room 1'
public 'description' => string 'This is\r\nMy test'
.....
.....
I am trying to remove \r\n
from description and here is my code for that
$noSymbols = preg_replace('~[\r\n]+~', ' ', $room->description)
Weird thing is if i change $room->description
with This is\r\nMy test
then i get my output as This is My test
but with php variable, it doesn't work and giving me output as This is\r\nMy test
.
Thanks!