Page 1 of 1

fwrite to middle of file (Maybe or an alternative?)

Posted: Fri Apr 09, 2004 11:08 pm
by Chris Corbyn
Hi,

I need to fwrite() to a file but keep everything that's written sandwiched between php tags.

I'm guessing it can't be difficult to do.

There may be another way to do what i want anyway. The stuff I'm writing is the elements of an array which I will do things with by including it with include() in another script. So can I somehow just have the page that's written to without php tags and let the other page read it as php anyway?

Thanks

Posted: Fri Apr 09, 2004 11:27 pm
by feyd
Why not just include a basic text file between the php tags? Then just include this file:

Code: Select all

<?php include('your_text_file_here.txt'); ?>
afaik, it'd work just fine. :)

Posted: Fri Apr 09, 2004 11:41 pm
by Chris Corbyn
Excellent cheers!

Don't know why I never considered that one myself :-/

It does work yeah