By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

parseing text file from web server

P: 2
I play a game that has raw news feeds stored in txt on there website. located
[HTML]http://a.swirve.com/data[/HTML]
My problem is I know nothing about PHP.
The basics of what I am trying to do is scan the file, insert into a mysql database.
Right now there is a whole sets worth of data. But when the next set starts there wont be that many files, or same file names used. The one thing that stays the same is the next to last file is the current hour of news. I am hoping to scan the txt files once every 5 mins. Any help would be appreciated.
Feb 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: 2
[PHP]<?php
$filename = "personal.txt";
$data = file( $filename );
foreach( $data as $jai )
]
{ [/PHP]

Thats what I have so far to open the txt file. Thou I not sure how to get that open the 2nd from the bottom file.

I got some help with inserting into mysql database

[PHP]
$jaiql = mysql_query("INSERT msql_table VALUES ('', '{$jai[0]}', '{$jait[3]}', '{$jait[7]}', '{$jai[1]}', '{$jai[2]}', '{$jai[3]}', '{$jai[4]}', '{$jai[5]}', '{$jai[6]}', '{$jai[7]}', '{$jai[8]}')");

print("$jai[0]--$jait[3]--$jai... -- $jai[4] -- $jai[5] - $jai[6] - $jai[7] - $jai[8]");
[/PHP]
Feb 26 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.