Jump to content

Writing to File, simple problem


mjlogan

Recommended Posts

Hi,

I can think of the actualy terms to search for this, but I have tried, just not found the right thing.

at the moment I have the code

[code]
<?php
$fh = fopen($myFile, 'w') or die("can't open file");

unset($stringData);

$stringData = "";
$stringData = $stringData. "<?php\n\n$lstJobTypeOptions = \"";

...

$stringData = $stringData. "\n\n?>";

fwrite($fh, $stringData);
fclose($fh);
?>
[/code]

which out puts in the file

[code]<?php

= "

?>[/code]

with the error

Notice: Undefined variable: lstJobTypeOptions ...................................

How do I get the script to acutally just write

[code]<?php

$lstJobTypeOptions = "

?>[/code]

Thanks, lol its beginning to annoy me  :-\



Edit:

Resolved, using ' instread of "
Link to comment
https://forums.phpfreaks.com/topic/29789-writing-to-file-simple-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.