-1

How can I save a file with a string on the client's device using php?

$handle = fopen("newfile.txt", "w+");

$txt = "string";

$content = fwrite($handle, $txt);
rafael
  • 51
  • 1
  • 2
  • 6

1 Answers1

0

Think that you actually cannot write files on the client's device, but you could follow this steps to have a similar result.

  1. Write a file with the string you want on the server side

  2. Download the file

  3. Delete the file from server

Hope this helps

rafael
  • 51
  • 1
  • 2
  • 6