Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,046 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,522 people online right now. Registration is fast and FREE... Join Now!




Variables From An External File

 
Reply to this topicStart new topic

Variables From An External File, how?

Koenie
19 Nov, 2002 - 06:57 AM
Post #1

What?!
*****

Joined: 8 Jul, 2002
Posts: 1,313

I have on file containing only a number. No PHP things in it, just the number. Can I make this number a variable in a PHP page, without having to change the number?

Koenie
User is offlineProfile CardPM
+Quote Post

jaybee
RE: Variables From An External File
19 Nov, 2002 - 07:13 AM
Post #2

New D.I.C Head
*

Joined: 30 Sep, 2002
Posts: 9

read the file into a var:
CODE

$filename = "num.text";
$fd = fopen ($filename, "rb");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);

User is offlineProfile CardPM
+Quote Post

Koenie
RE: Variables From An External File
19 Nov, 2002 - 07:51 AM
Post #3

What?!
*****

Joined: 8 Jul, 2002
Posts: 1,313

Right....

Thanks!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 05:00PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month