views:

20

answers:

1

I can read files using PHP from a network share, but how can I create a file and folder on a network share?

+1  A: 

Same way you would a local file.

$fp = fopen("\\\\server\\share\\folder\\file.txt","w");

You must have permission to create/write, also.

Fosco
I don't think it works without the slashes. Because `'\\'` is interpreted as the string: `\`... Either way, the extra escaping can't hurt...
ircmaxell
@ircmaxwell, thanks.. removed that second example.
Fosco