In the project,the above code need to be put into String(see 2nd snippet). However,
$string =""
add escaping slashes