Web >> Development >> PHP >> How to convert a multiple line string to a javascript compatible multiple line string

Note in javascript when assigning multiple line string value a backslash \ is needed in every line var str = "first\ second\ third\ ";