Andrew Liu Andrew Liu - 1 year ago 85
PHP Question

PHP how to write echo inside a copy function

Pretty straight forward. I want to do something like this:

copy("/home/website/", "/home/website/ $_SESSION['name'];.html");

However, it doesn't seem to work.

Answer Source

You can't echo something when you're in the middle of the statement. Concatenate it instead:

 copy("/home/website/", "/home/website/".$_SESSION['name'].".html");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download