带 的字符串导致后续变量错误[关闭]

I have a variable that has , spaces and other symbols in and is causing errors (Notice: Undefined offset: 0) in my code. I am trying to update the terminal note on my MikroTik routers via API but when the note variable has multiple lines and 's and so on, it causes the rest of the code not to work and gives me errors. How can I fix this?

My code:

$config['routeros']['note'] = "\
    
 ------------------------------------------------------------\
    
 Warning! This device is secured by\
    
   _____                          ____                     _ \
    
  / ____|                        |  _ \\                   | |\
    
 | |  __  _ __  ___   ___  _ __  | |_) |  __ _  _ __    __| |\
    
 | | |_ || '__|/ _ \\ / _ \\| '_ \\ |  _ <  / _` || '_ \\  / _` |\
    
 | |__| || |  |  __/|  __/| | | || |_) || (_| || | | || (_| |\
    
  \\_____||_|   \\___| \\___||_| |_||____/  \\__,_||_| |_| \\__,_|\
    
                                              N E T W O R K S\
    
 ------------------------------------------------------------\
    
  \
    
 Unauthorised access is prohibited and shall render the user \
    
 liable to criminal and/or civil prosecution.";

Code snip of PHP file

Output of print_r($config);

Output of print_r($config);

Haven't been able to sort that issue out as nothing wants to fix it so I have now come up with a solution. I created a function that checks the files on my router, if it exists then it skip but if there is not sys-note.txt file on the router, it will then enable ftp service(if disabled), then upload the sys-note.txt file from my server to the Router and then disable ftp again only if it was disabled to begin with.

Use a heredoc. Example:

config['routeros']['note'] = <<< END
    ------------------------------------------------------------
    Warning! This device is secured by\
       _____                          ____                     _ 
      / ____|                        |  _ \\                   | |
     | |  __  _ __  ___   ___  _ __  | |_) |  __ _  _ __    __| |\
     | | |_ || '__|/ _ \\ / _ \\| '_ \\ |  _ <  / _` || '_ \\  / _` |
     | |__| || |  |  __/|  __/| | | || |_) || (_| || | | || (_| |\
      \\_____||_|   \\___| \\___||_| |_||____/  \\__,_||_| |_| \\__,_|
                                                  N E T W O R K S
    ------------------------------------------------------------
    Unauthorised access is prohibited and shall render the user
    liable to criminal and/or civil prosecution.
END;