var include file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pppswing
Forum Commoner
Posts: 33
Joined: Thu Jun 10, 2004 2:04 am
Location: Tallinn, Estonia

var include file

Post by pppswing »

Hello,

I need to put the content of a file in a variable. How can I do that ?
I mean better than this :
їphp]
$handle = fopen($topmenufile, "r");
$topmenu = fread($handle, filesize($topmenufile));
fclose($handle);
ї/php]
Thanks, :)

?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]file_get_contents[/php_man]() or [php_man]file[/php_man]().
Post Reply