In this code :
$path = "C:\NucServ\www\vv\static\arrays\news.php";
$fp = fopen($path, "w");
if(fwrite($fp=fopen($path,"w"),$text))
{
echo "ok";
}
fclose($fp);
I have this error message:
failed to open stream: Invalid argument
What is wrong in my code?
Your backslashes is converted into special chars by PHP. For instance,
...arrays\news.phpgets turned intoYou should escape them like this:
Or use singles, like this:
Also, your
ifis messed up. You shouldn’tfopenthe file again. Just use your$fpwhich you already have.