Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
variable like this:
$a=include(th-file.php);
Will this give me any extra problems later on? or is
this resource intensive?
The reason I am doing this is because I want to put
whole pages
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.
On Thu, 14 Oct 2004 10:35:15 -0700 (PDT), Mag [EMAIL PROTECTED] wrote:
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
[snip]
$a=include(th-file.php);
[/snip]
Mag,
I have never seen this approach before.
This is the way I would do something like
that.
$file=./th-file.php;
if (!($fp = fopen($file,r))){
echo Could not open .$file;
exit();
}
$a = fread($fp, filesize($file));
fclose($fp);
See
* Thus wrote Mag:
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
variable like this:
$a=include(th-file.php);
Will this give me any extra problems later on? or is
this resource intensive?
The reason I am doing this is
ApexEleven wrote:
I believe that include() returns true|false, so $a would equal true if
the file is included and false if it is not.
If you use *return* on global scope in include file that value will be
returned to $a.
-- test.php --
$test = Hello;
return $test;
-
$a = include test.php;
//
Mag wrote:
Hi,
I have never done this before (but in my first test it
seems to work), I am include()ing a file into a
variable like this:
$a=include(th-file.php);
Will this give me any extra problems later on? or is
this resource intensive?
I've seen other people do something similar to this,
but
Hi Curt,
Thanks for replying.
class SaveToFile {
function open($file) {
//open file...
}
function write($buf) {
//write to file...
}
function close() {
//close file
}
}
$obSaveFile = new SaveToFile();
$obSaveFile-open('/path/to/file.html');
* Thus wrote Mag:
Hi Curt,
Thanks for replying.
$obSaveFile = new SaveToFile();
$obSaveFile-open('/path/to/file.html');
ob_start(array($obSaveFile, 'save'), 1024);
/* do your stuff here */
ob_end_flush();
$obSaveFile-close();
Problem is, I have not really learnt classes
This is what I'm trying to do, and I think I'm just missing some logic in
how to think like PHP.
I have a global included file (global.inc) where I set up variables, open
the database, etc, and I include it in the header of every HTML file on the
site.
One thing I would like to set as a
9 matches
Mail list logo