seting $var then using it in implode ('', file ('FILE.php));
Posted: Mon Feb 03, 2003 12:44 pm
i have an example that looks like this:
index.php
FILE.php
* is there any way to use the variable created in index.php in FILE.php without setting a cookie, creating session or moving it into FILE.php via address (FILE.php?variable=$variable)???
* it would be also much better if i could use INCLUDE function, the only thing is, i need that file to return a string, not in the way include() function does.
* the reason why i can't use include function is, becuase i don't output anything with echo or print but i save everything in a variable $template.. and if i do include function before the final echo $template, then the FILE won't be on the place where i want it to be..
any ideas? please help...
-thank you all
index.php
Code: Select all
$variable = "something for the beggining";
// now i include file (but i cannot use the INCLUDE function)...
implode ('', file ('FILE.php));Code: Select all
// that doesn't work!!!
echo $variable;* it would be also much better if i could use INCLUDE function, the only thing is, i need that file to return a string, not in the way include() function does.
* the reason why i can't use include function is, becuase i don't output anything with echo or print but i save everything in a variable $template.. and if i do include function before the final echo $template, then the FILE won't be on the place where i want it to be..
any ideas? please help...
-thank you all