1

Some API is providing json file of 88MB. I need to store in some of its value in database.

$cURL="url here"
$str = file_get_contents($cURL);
$str = json_decode($str);
echo '<pre>';
print_r($str);   

this code is not working because file size is too large. I need to convert that json file to a php array. I am not able to parse this file. Any help from anyone?

1

1 Answer 1

1

Quite complicated if the problem should be solved during the query. Caching the preliminary data on the filesystem then separate the values into chunks would be able to solve the issue.

Sign up to request clarification or add additional context in comments.

4 Comments

I know parsing will help but how to parse it? i have tried a few techniques but not helping.
A little code would give me an insight to help you. I need you to answer some specific questions though, a) Data being returned b) Specific keys to be used
i already gave you code in the question. in first line i took the url in a variable. if i run that url in browser, that will download a json file of 88MB
The code above is vague and unhelpful. Since it's a JSON response, there's undoubtedly chunks of keys lying around in which you can omit.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.