Page 1 of 1

fwrite command with additional quotes and semi-colons?

Posted: Wed Sep 17, 2003 3:39 pm
by FinalAeon
here's the problem, i need to be able to have the command:

-----------------------------------------------------------------

$fw = fopen("/home2/fearmysk/public_html/$reviewtitle.php","w+");

fwrite($fw,<?php include("something.txt"); ?>);

fclose($fw);

-----------------------------------------------------------------

this means that it's going to write to a file that i specified ,<?php include("something.txt"); ?> but since it has a semi-colon before the end of the fwire command, it cuts it off there thinking it's the end of the fwrite command, i know that u can get around this in C++ with a forward slash like \" but it doesn't seem to work here, can someone please help me?

Thank you,

FinalAeon

Posted: Wed Sep 17, 2003 3:51 pm
by m3rajk
why are you opening php inside of php?

Posted: Wed Sep 17, 2003 6:05 pm
by JAM

Code: Select all

$fw = fopen("/home2/fearmysk/public_html/$reviewtitle.php","w+"); 

fwrite($fw,'<?php include("something.txt"); ?>'); // note the single quotes...

fclose($fw);