www.webdeveloper.com
Results 1 to 4 of 4

Thread: Reading and storing partial data from a file

Threaded View

  1. #1
    Join Date
    Sep 2006
    Posts
    655

    Question Reading and storing partial data from a file

    Hello

    I have a question about reading chunks of data from a file.

    Suppose I have the following array saved in a file:

    Code:
    Array
    (
        [Japan] => Array
            (
                [0] => 101
                [1] => 102
                [2] => 103
            )
    
        [China] => Array
            (
                [0] => 202
                [1] => 203
                [2] => 204
            )
    
        [Chicago] => Array
            (
                [0] => 303
                [1] => 304
                [2] => 305
            )
    
    )
    Is there anyway I can open the file but just read and store the "Chicago" array elements in a variable? The reason I am asking is because The file many contain a huge list of arrays and reading the entire array and dumping them in the memory wont be a good idea. So how can we accomplish this?


    Thanks in advance

    PS: The extension of the file is .json and the data storage format would be JSON as well..
    Last edited by phantom007; 03-09-2014 at 03:09 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles