SyntaxFix
Write A Post
Hire A Developer
Questions
If I understood you right, you want to copy $var in a file (if it's a string).
$var
echo $var > $destdir