I have this code: if (fwrite($handle,"
# $hostname.$domainname
add username $hostname.$domainname {$username}
add password $hostname.$domainname {$password}
add autoenable $hostname.$domainname {$autoenable}
add method $hostname.$domainname {$method}
add device $hostname.$domainname {$devicetype}
add encryption $hostname.$domainname {$encrypt}
add userprompt $hostname.$domainname {\"User Name:\"}
" )
I need the output to actually keep the curly braces in the file I am writing to, so the output would for example look like this:
#host123.yahoo.com
add username host123.yahoo.com {test}
add password host123.yahoo.com {testpass}
add autoenable host123.yahoo.com {1}
add method host123.yahoo.com {ssh}
add device host123.yahoo.com {cisco}
add encryption host123.yahoo.com {3des}
add userprompt host123.yahoo.com {\"User Name:\"}
I have tried using double quotes and then single quotes to try and keep the braces, tried escape character \ and spent a lot of time online looking all over. From what I have read, you cannot escape a Curly brace before a variable. Confused on how the syntax should be.
ANy help would be awesome.