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.