Andrew Liu Andrew Liu - 2 months ago 9x
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.


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");