Third Party Contributions > API Based Plugins

how create new file php

(1/1)

ayoub:
I am currently developing a plugin
the problem is that I need to create a file
I tried this code:

 $a = 'hello friend';
   //$tmpfname = touch('/home/user/file.txt');
   $fp = fopen("/home/user/file.txt", "a");
   fwrite($fp,$a);
   fclose($handle);

but the problem is not resolved
Can you  help me please
thks

rosali:
file_put_contents("/home/user/file.txt", $a);

ayoub:
thks
but the problem that the file is not created

rosali:
Check folder permissions. Code is ok. This is not a php support forum.

Navigation

[0] Message Index

Go to full version