Looking for help reading a .txt or .ini file and outputting the info.


Posted on 16th Feb 2014 07:03 pm by admin

I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I would like it to be in a php file as just 0 if possible. Also how would I do this from php file to php file and let me explain.
Did you know?Explore Trending and Topic pages for more stories like this.


Server 1 Game Server
Server 2 Website

Both have Apache but of course I can't move the info.ini so I point the php script right to it then another php script on my server 2 would read it and do whatever it likes. My goal really is to have a simple .php stats page or maybe learn how to make it into GD in the future.

Any help would be great this what I was able to do so far:

Code: <?php
$myFile = "C:lalalalalalainfo.ini";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;


Thanks,
No comments posted yet

Your Answer:

Login to answer
172 Like 44 Dislike
Previous forums Next forums
Other forums

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

How to get all server headers like Live http Headers does
Hey all, like many of you I use the Firefox addon "Live http Headers". I'm trying to write

parsing error
can anyone explain this syntax error:

Parse error: syntax error, unexpected T_IF

The e

Keeping track of php uploads
Hello all.

I was looking at the way PHP handles file uploads.
It seems that PHP uses a tem

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

User feedback after MySQL query has been executed
Hi all, I've just registered on PHPFreaks because I've got a question that I simply can't work out b

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat n

TabControl Inside ListView Not Editing
Hello everybodyI have a ListView on my page. Inside the ListView I put a TabControl, cuz I want to p

Staff Induction System - No idea where to go from here!!!
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash