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

Prevent PHP mail( ) from appending hostname to from address
Hey guys,

I want to be able to send texts to phones via email (since each phone has their own

Dynamically allocating the number of rows in a table based on a variable value
Hi,
I have situation here which i cannot resolve, I have a variable temp which stores the num

New Search Engine problem
Hey everyone,

I have a ZIP Code Radius search engine already functional. it displays all of t

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

ORA-01655: unable to extend cluster SYS.C_FILE#_BLOCK# by 128
Hi all,

Oracle 10g. Linux.

I'm facing the below error while trying to import a dumpfil

Odd or Even
Inside of a while loop I need to echo several rows of info...easy enough.

In the loop (for th

If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to ad

gather checkbox data from form into email
Hello all,

First, i'd like to thank everyone who responded to my previous posts regarding set

Doubles are giving me problems
Ok so, first of all i made a double = 0.05, but when running the debugger it shows up as 0.04999. I

Please help - should be a simple fix.. driving me nuts
Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and

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