Incoming data into array?

This is a discussion on Incoming data into array? within the PHP Language forums, part of the PHP Programming Forums category; Hi, I'm opening a remote file on a regular basis, the data is in the following format and has ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-27-2006
elyob
 
Posts: n/a
Default Incoming data into array?

Hi, I'm opening a remote file on a regular basis, the data is in the
following format and has a line feed of "0D 0A". The spaces are 20 in hex
mode.

2006-07-26 22:00:03.000000 4.370996 51.656616
2006-07-26 22:00:03.000000 2.599964 49.286836
2006-07-26 22:00:03.000000 0.876824 48.418013
2006-07-26 22:00:04.000000 1.543656 50.926529
2006-07-26 22:00:04.000000 1.070219 48.759254

Firstly, this incoming data is oldest first and is continually updating.
However it only shows the previous hours data. My main aim is to take this
data and split it into an array. Currently I'm using file_get_contents(),
and am just wondering what the best method to get this into a workable
format?

Thanks


Reply With Quote
  #2 (permalink)  
Old 07-27-2006
Chung Leong
 
Posts: n/a
Default Re: Incoming data into array?


elyob wrote:
> Hi, I'm opening a remote file on a regular basis, the data is in the
> following format and has a line feed of "0D 0A". The spaces are 20 in hex
> mode.
>
> 2006-07-26 22:00:03.000000 4.370996 51.656616
> 2006-07-26 22:00:03.000000 2.599964 49.286836
> 2006-07-26 22:00:03.000000 0.876824 48.418013
> 2006-07-26 22:00:04.000000 1.543656 50.926529
> 2006-07-26 22:00:04.000000 1.070219 48.759254
>
> Firstly, this incoming data is oldest first and is continually updating.
> However it only shows the previous hours data. My main aim is to take this
> data and split it into an array. Currently I'm using file_get_contents(),
> and am just wondering what the best method to get this into a workable
> format?
>
> Thanks


http://fi.php.net/file

Reply With Quote
  #3 (permalink)  
Old 07-27-2006
elyob
 
Posts: n/a
Default Re: Incoming data into array?


"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:1153962861.032797.37480@m73g2000cwd.googlegro ups.com...
>
> elyob wrote:
>> Hi, I'm opening a remote file on a regular basis, the data is in the
>> following format and has a line feed of "0D 0A". The spaces are 20 in hex
>> mode.
>>
>> 2006-07-26 22:00:03.000000 4.370996 51.656616
>> 2006-07-26 22:00:03.000000 2.599964 49.286836
>> 2006-07-26 22:00:03.000000 0.876824 48.418013
>> 2006-07-26 22:00:04.000000 1.543656 50.926529
>> 2006-07-26 22:00:04.000000 1.070219 48.759254
>>
>> Firstly, this incoming data is oldest first and is continually updating.
>> However it only shows the previous hours data. My main aim is to take
>> this
>> data and split it into an array. Currently I'm using file_get_contents(),
>> and am just wondering what the best method to get this into a workable
>> format?
>>
>> Thanks

>
> http://fi.php.net/file
>


I always like short answers, thanks!



Reply With Quote
  #4 (permalink)  
Old 07-27-2006
Miguel Cruz
 
Posts: n/a
Default Re: Incoming data into array?

"elyob" <newsprofile@gmail.com> wrote:
> Hi, I'm opening a remote file on a regular basis, the data is in the
> following format and has a line feed of "0D 0A". The spaces are 20 in hex
> mode.
>
> 2006-07-26 22:00:03.000000 4.370996 51.656616
> 2006-07-26 22:00:03.000000 2.599964 49.286836
> 2006-07-26 22:00:03.000000 0.876824 48.418013
> 2006-07-26 22:00:04.000000 1.543656 50.926529
> 2006-07-26 22:00:04.000000 1.070219 48.759254
>
> Firstly, this incoming data is oldest first and is continually updating.
> However it only shows the previous hours data. My main aim is to take this
> data and split it into an array. Currently I'm using file_get_contents(),
> and am just wondering what the best method to get this into a workable
> format?


Are there no spaces within fields? Just use fgetcsv() with ' ' as the
delimiter.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0