View Single Post
  #1 (permalink)  
Old Feb 4th, 2008, 19:13
WebNinja WebNinja is offline
Junior Member
Join Date: Sep 2006
Location: Here
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Syntax to include a file as a variable???

I'm appending a few lines of text to a file. The text may change later, so I want to make it an include for easy edit.

What is the right syntax to include a file as a variable?

I can declare straight text and it works fine. But how can I include some text from a file?

PHP: Select all

<?php
     $Text 
'I can put text here and it works';

     
$New fopen("$page.php","a");
     
fputs($New"$Text");
     
fclose($New);
?>
Something like this???

PHP: Select all

<?php
     $Text 
= include(this/dont/work.inc);

     
$New fopen("$page.php","a");
     
fputs($New"$Text");
     
fclose($New);
?>
Thanks for any help offered.
Reply With Quote