I am trying to creat a new file with some varibles being assigned in it. I'll show you what I have that doesn't work and if you could tell me what to fix I would be happy.
Here is the code I have for this.
$modname = "newname";
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "<?php\n";
fwrite($fh, $stringData);
$stringData = "$modversion['name'] = \"$modname\";//name of module\n";
fwrite($fh, $stringData);
fclose($fh);
This is what I tried with the hopes that the product would be a file named test.txt with the content
<?php
$modversion['name'] = "newname";//name of module
it doesn't work though.
Help please!
Thanks,
Steve