Basic php question (string concatenation )
Posted: Mon Aug 24, 2009 2:02 pm
Hi
This is what I have -
I want to create a file in a particular folder .This doesn't works
However if I change
to
or
It works . Can someone tell me whats wrong in the original code ?
I hope its clear from the code what I am trying to do.
Thanks
This is what I have -
Code: Select all
$newfile1 = uniqid (true).".html" ;
$newfile = "categories\books\".$newfile1 ; //This is the important line
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file); I want to create a file in a particular folder .This doesn't works
However if I change
Code: Select all
$newfile = "categories\books\".$newfile1 ;Code: Select all
$newfile = "categories\books\foo";Code: Select all
$newfile = $newfile1 ;I hope its clear from the code what I am trying to do.
Thanks