I want to get a specific part of the file instead of using the file_get_contents() function to pull the whole file. For example i have a json file like below.
{
"0": {
"id":1,
"name":"test1",
},
"1": {
"id":2,
"name":"test2",
}
}
As above, there is a json data with 10,000 keys. And there are more than 1500 files like this. Among these files, I want to get the part with a data with id = 4999, for example, from a file with the above data.
Is the only way around this by pulling the entire contents of the file and decoding it and then searching? Or is there an easier way?
The reason I'm asking this is, for example, there will be 10 different data on a page. And this data may be the information contained in the content of 10 different files. When I pull and decode all 10 of these files, an array will have 100,000 pieces of data. Will this slow down the system?