How to write $ and other symbols to a file in php
Posted: Sat Mar 15, 2008 7:17 pm
Okay so I have a script that needs to write a few things (okay like 100 things...) to a file.
It works perfectly, except for ONE thing.
Every time I tell it to write something like $hello... it substitutes the value of $hello (which since it's not assigned is blank).
My code:
What I want to see in the file is:
echo "$footerhere";
what I see is:
echo "";
How do I make it write the var. name?
It works perfectly, except for ONE thing.
Every time I tell it to write something like $hello... it substitutes the value of $hello (which since it's not assigned is blank).
My code:
Code: Select all
$stringData = "echo \"$footerhere\"; \n";
fwrite($fh, $stringData);echo "$footerhere";
what I see is:
echo "";
How do I make it write the var. name?