fwrite command with additional quotes and semi-colons?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
FinalAeon
Forum Newbie
Posts: 17
Joined: Sat Aug 02, 2003 2:51 pm
Location: ATL, GA

fwrite command with additional quotes and semi-colons?

Post 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
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

why are you opening php inside of php?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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);
Post Reply