xoxox xoxox - 1 year ago 91
PHP Question

How can I insert a value into a string without concatenation?

My goal is to insert a variable's value directly into a string without concatenation using the


I tried like this:

$filename = 'some_file_name';
header('Content-disposition: attachment; filename=$filename');

But this gives me
, not

How do I achieve this? What am I missing?

Answer Source
$filename = "path/to/file.txt";
header("Content-disposition: attachment; filename=$filename");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download